close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

DataAssist help

Thread began 2/22/2012 9:32 am by Kumel | Last modified 3/01/2012 2:28 pm by Jason Byrnes | 4516 views | 20 replies |

Kumel

DataAssist help

I was reconstructing the website & i m stuck at a place where i need help..
PLEASE ASAP.

My website is all about purchasing digital goods online.
First of all i have inserted all data Assist wizard pages.. like productserach,results,details & etc pages etc...
on detail page i have added a add to cart button. everythign functioning properly.

now in product search page when a there is no value entered it takes me to result page & shows all the products available..
So how we show if something wrong is entered on search product text field..
& in Product DB, i have entered a new field called ProductUser. Here i store UserID of a user.
Mainly i have some product for particular users only.. so please help me on this..


***********************
i tried changing values some values @ product result page i.e
DataAssist search server behavior, i set the default where clause to:
0 <> 0

& so when i run the page empty ie. if i open only productresult.php page then i get error like --->

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '0 <> 0 ORDER BY ProductName ASC LIMIT 0, 5' at line 1

I have attached da file please look into it.

Attached Files
files.zip
Sign in to reply to this post

Jason ByrnesWebAssist

your recordset already has a where clause in it, so i think the default where clause should be:
AND 0 <> 0

if that does not fix the error, change the following line:

php:
$WADAproducts = mysql_query($query_limit_WADAproducts, $Connection1) or die(mysql_error());



to:

php:
$WADAproducts = mysql_query($query_limit_WADAproducts, $Connection1) or die(mysql_error()."<br />".$query_limit_WADAproducts);




this will write the sql causing the error to the page so we can look into it further.

Sign in to reply to this post

Kumel

i made both the changes. in productresult.php page it still shows all the products available for that user. & Now i m getting many errors ->

Missing argument 2 for GetSQLValueString(), called in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 93 and defined in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 47

Notice: Undefined variable: theType in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 59

Notice: Undefined variable: theType in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 60

Notice: Undefined variable: theType in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 63

Notice: Undefined variable: theType in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 66

Notice: Undefined variable: theType in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 69





i have attached file once again. please look into it.

Sign in to reply to this post

Kumel

there you the file..

Attached Files
PR.zip
Sign in to reply to this post

Kumel

Im a lot of this error all time.. Parse error: syntax error, unexpected ';' in C:\xampp\htdocs\AniSnapFeb\SnapDetail.php on line 101


This is another page.. It says unexpected ";" so if i remove ':' i get error like this -->

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\AniSnapFeb\SnapDetail.php on line 102

btw these above errors used to come even at productresult.php page ( that is uploaded in my previous post.
I have uploaded SnapDetail.php page. please look into it also.. ty

Attached Files
SD.zip
Sign in to reply to this post

Jason ByrnesWebAssist

the code for the products is duplicated on your results page. delete the code at lines 88 - 97:

php:
$colname_WADAproducts = "-1";

if (isset($_SESSION['SecurityAssist_UserID'])) {
  $colname_WADAproducts = (get_magic_quotes_gpc()) ? $_SESSION['SecurityAssist_UserID'] : addslashes($_SESSION['SecurityAssist_UserID']);
}
mysql_select_db($database_Connection1, $Connection1);
$query_WADAproducts = sprintf("SELECT * FROM products WHERE productUser = %s ORDER BY ProductName ASC", GetSQLValueString($colname_WADAproducts));
$query_limit_WADAproducts = sprintf("%s LIMIT %d, %d", $query_WADAproducts, $startRow_WADAproducts, $maxRows_WADAproducts);
$WADAproducts = mysql_query($query_limit_WADAproducts, $Connection1) or die(mysql_error()."<br />".$query_limit_WADAproducts);
$row_WADAproducts = mysql_fetch_assoc($WADAproducts);




i think the error you are getting is caused by line 116:

php:
$query_WADAproducts = sprintf("SELECT * FROM products WHERE productUser = %s ORDER BY ProductName ASC", GetSQLValueString($colname_WADAproducts, "-1"));




this should be changed to:

php:
$query_WADAproducts = sprintf("SELECT * FROM products WHERE productUser = %s ORDER BY ProductName ASC", GetSQLValueString($colname_WADAproducts, "int"));





on the detail page line 101:

php:
$query_WADAuploads = sprintf("SELECT UploadID, UploadedFileName, Comments, Status, AniSnapImg, UploadThumb, AniSnapCode FROM uploads WHERE UploadID = %s OR ( -1= %s AND UploadID= %s)", GetSQLValueString($ParamUploadID_WADAuploads,"int"),GetSQLValueString($ParamUploadID2_WADAuploads)



should be:

php:
$query_WADAuploads = sprintf("SELECT UploadID, UploadedFileName, Comments, Status, AniSnapImg, UploadThumb, AniSnapCode FROM uploads WHERE UploadID = %s OR ( -1= %s AND UploadID= %s)", GetSQLValueString($ParamUploadID_WADAuploads, "int"),GetSQLValueString($ParamUploadID2_WADAuploads, "int"),GetSQLValueString($ParamSessionUploadID_WADAuploads, "int"));
Sign in to reply to this post

Kumel

I made all the changes .. @ snapdetail.php page i m not getting any errors but all the products are FOR THAT USER IS been shown in productresult page only when blank entry/anything is typed search product text field. (i.e in snapdetail.php page )

& in snapdetail.php page others details can be checked by other users (i.e by using ********/SnapDetail.php?UploadID=8) n etc.

No errors are displaying.. but i dont want to show other upload details to others & dont want to show all product in productresult page even when u type something wrong..

Sign in to reply to this post

Kumel

In snapdetail.php page everything is displayed with this error ---->
Undefined variable: Products in C:\xampp\htdocs\AniSnapFeb\SnapDetail.php on line 298
Warning: mysql_free_result() expects parameter 1 to be resource, null given in C:\xampp\htdocs\AniSnapFeb\SnapDetail.php on line 298

other users can view other details in this page still.

Sign in to reply to this post

Jason ByrnesWebAssist

on the detail page, you have not added a condition to the recordset where clause for the user ID, you need to configure the recordset to filter using the user ID session variable.


at line 298 you have the following code:
mysql_free_result($Products);

that recordset does not exist on this page, delete it.

for the results page, to help troubleshoot, add the following code after the body tag and post back the SQL that it outputs:

php:
<?php echo("SQL: ".$query_limit_WADAproducts); ?>
Sign in to reply to this post

Kumel

At result page i m getting two errors...

Notice: Undefined variable: query_WADAproducts in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 91
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\AniSnapFeb\products_Results.php on line 92




& @ the end of the productresult page i m getting error like this-->


SQL: SELECT * FROM products WHERE productUser = 1 ORDER BY ProductName ASC LIMIT 0, 5

Sign in to reply to this post
loading

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...