close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Recordset Errors

Thread began 9/02/2010 12:46 pm by gpaul | Last modified 9/09/2010 9:53 am by gpaul | 2681 views | 3 replies |

gpaul

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

Sign in to reply to this post

tom92909Beta Tester

I assume that you'll be locating each record in the following manner...

myimage_detail.php?image_id=32

Right?

If that's the case and you're not using any specific SEARCH criteria on your "results" page, then you can simply remove all of the

Paramimage_id
Paramimage_id2
ParamSessionimage_id

From your Recordset - Variables section in Dreamweaver.
All that really matters is

php:
Paramimage = $_GET['image_id']




The SEARCH (form) on your details page is controlled by the additional variable parameters that appear to be producing your errors.

Something like that should resolve the errors I think.

:)

Sign in to reply to this post

Jason ByrnesWebAssist

This is a problem with Dreamweaver / DataAssist and the underscore naming convention.


The issue is this:
In DataAssist, when a parameter is created, it uses the name of the column to ensure that the parameter name is unique


the variable name for the parameter is written as:
$Param<columnName>_<RecordsetName>


so for the image_id column the parameter code is created as:
$Paramimage_id_WADAimages


When Dreamweaver inspects the code, it interprates everything after the first underscore as the recordset name.

so Dreamweaver sees:
$Paramimage_id_WADAimages


as:
rparameter name:
$Paramimage

recordset name:
id_WADAimages


thwe work around is to change the names of the parameters in the code. for example find:
$Paramimage_id_WADAimage


and change it to:
$Paramimageid_WADAimage

Sign in to reply to this post

gpaul

Thank you

I would like to apologize for not responding sooner and thank you for your help.

Tom

You were correct

<<I assume that you'll be locating each record in the following manner...

myimage_detail.php?image_id=32>>

However

$query_WADAimages = sprintf("SELECT image_id, caption, where_taken, description, file_name, image_file, submitted FROM images WHERE image_id = %s"), GetSQLValueString($ParamSessionimage_id_WADAimages,"int"));

produced a Parse error, saying an unexpected , (comma) was encountered. I tried a few variations however could not shake the errors.

I was finally able to get things to work (almost), I created a new set of files, I still encountered the same creation of the Paraimage variables, but was able to work around them.

It is perplexing and frustrating that these are created, even more so that Dreamweaver rejects them as incorrect.

Either way, I got a good education in WA and almost have it working the way I want.

Jason

Thanks for that information, I will use camelCase naming when using WA. I guess I should be happy I did not name that column select_where_from, dreamweaver might have thrown a major hissy fit...

Thanks again for your help.

Gary

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...