|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have read the article of Mitchell Harper Building A Persistent Shopping Cart With PHP and MySQL, but the products.php script does not run, can anyone have a look on the code and tell me what is wrong?
Cheers *edit* Please read forum rules before posting... Your title does not properly describe the topic *edit* |
|
#2
|
|||
|
|||
|
I just downloaded the support material and tested it...it works fine on my PC! Are you getting any errors, etc when you run the code? YOu'll have to give us a bit more detail. You ca't just say it doesnt work. Have you setup the MySQL login details, etc? and built the database?
__________________
i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope.i am cope. i drink coke. i am in hope. |
|
#3
|
|||
|
|||
|
does not run??? you need to tell us exactly what happened, and what errors you have got
Thanks |
|
#4
|
|||
|
|||
|
Hmm, it doen't work for me. I tested the scripts but I'll get the same stupid error message over and over again.
What I'm doing wrong.... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in c:\phpdev\www\cart\products.php on line 43 |
|
#5
|
|||
|
|||
|
You may have to call-out your variables in your Functions as global ( inside the top of each functions) like:
function RemoveItem($itemId) { global $dbserver, $dbuser, $dbpass, $dbname, $cxn; $cxn = @ConnectToDb($dbserver, $dbuser, $dbpass, $dbname); mysql_query("delete from cart where cookieId = '" . GetCartId() . "' and itemId = $itemId"); } I had the same problem, and this fixed everything for me. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Mitchell Harper |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|