Page 1 of 1

Problem And Errors in Page

Posted: Wed Dec 06, 2006 11:32 pm
by dharprog
Hi,

I have a script that is related to Shopping Cart. My Problem is when i open the Shopping site and Admin Panel in same Internet Explorer by using "Add Tab" (Without Opening a New window), I'm getting errors in account page when i update the Admin page of Orders Page thsoe Errors Are:


Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\shopcart\account.php on line 10

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\shopcart\account.php on line 87

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\shopcart\account.php on line 121

Again after that if i logged out from that Shopping Site and if logged in there are no Errors.

Again if i update in Admin panel instantly when i refresh the Account Page Again Errors

So what is this Problem i'm not getting there is no Equal sessions from admin panel and this Account Page. ALl are different. Only Table name is same means orders table.

what i have to do can anybody give me suggestion or give me an idea though any of some one may face this problem.

If i use the Admin Panel and Site in Two different Internet Explorer WIndows there is no Errors even after Updating the Orders page in admin.,

Thank You...

Posted: Thu Dec 07, 2006 12:11 am
by volka
You have to check the return value of mysql_query. If it is ===false an error occured. see http://de3.php.net/mysql_error.
For debugging purposes you might use something like

Code: Select all

$query = 'SELECT x,y,z FROM abc WHERE Easter=Pentecost';
$result = mysql_query($query, $mysql) or die(mysql_error().': '.htmlentities($query));
It will print the error message and the query (might not be a good idea on a production server) and then abort the script.