Recordset Errors
When creating new page through the Data Assist Wizard, there is a recordset that is being created that full of variable errors. The error message is
Paramimage is an invalid variable name; it does not appear in the SQL
Missing type for variable:Paramimage
ParamSessionimage is an invalid variable name; it does not appear in the SQL
Missing type for variable:ParamSessionimage
Paramimage is an invalid variable name; it does not appear in the SQL
Missing type for variable:Paramimage
Missing Run-Time Value for variable:Paramimage_id
Missing Run-Time Value for variable:Paramimage_id2
Missing Run-Time Value for variable:ParamSessionimage_id
Within the code there is no Paramimage or ParamSessionimage. There are Paramimage_id,Paramimage_id2, ParamSessionimage_id, however they do not have runtime values.
I tried to delete the Paramimage and ParamSessionimage, but they simply re-appear.
I tried to take the runtime values from theParamimage and ParamSessionimage and apply them to Paramimage_id,Paramimage_id2, ParamSessionimage_id, but it returns no records on a test, and the 3 invalid variables re-appear again upon reopening the recordset.
Below is the corresponding code for the recordset.
<?php
$Paramimage_id_WADAimages = "-1";
if (isset($_GET['image_id'])) {
$Paramimage_id_WADAimages = (get_magic_quotes_gpc()) ? $_GET['image_id'] : addslashes($_GET['image_id']);
}
$Paramimage_id2_WADAimages = "-1";
if (isset($_GET['image_id'])) {
$Paramimage_id2_WADAimages = (get_magic_quotes_gpc()) ? $_GET['image_id'] : addslashes($_GET['image_id']);
}
$ParamSessionimage_id_WADAimages = "-1";
if (isset($_SESSION['WADA_Insert_images'])) {
$ParamSessionimage_id_WADAimages = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_images'] : addslashes($_SESSION['WADA_Insert_images']);
}
mysql_select_db($database_jfinlocal, $jfinlocal);
$query_WADAimages = sprintf("SELECT image_id, caption, where_taken, description, file_name, image_file, submitted FROM images WHERE image_id = %s OR ( -1= %s AND image_id= %s)", GetSQLValueString($Paramimage_id_WADAimages, "int"),GetSQLValueString($Paramimage_id2_WADAimages, "int"),GetSQLValueString($ParamSessionimage_id_WADAimages, "int"));
$WADAimages = mysql_query($query_WADAimages, $jfinlocal) or die(mysql_error());
$row_WADAimages = mysql_fetch_assoc($WADAimages);
$totalRows_WADAimages = mysql_num_rows($WADAimages);?>
This is the SQL
SELECT image_id, caption,
WHERE _taken, description, file_name, image_file, submitted FROM images WHERE image_id = Paramimage_id OR ( -1= Paramimage_id2 AND image_id= ParamSessionimage_id)
Also, one of my columns is where_taken, which is being transformed in the recordset into WHERE _taken, which also creates an error, but it re-appears after I correct it.
Anyone be able to help me straighten this out?
Thank you.
Gary