Please debug this php mysql script?

Affs Dsfs

New member
heyy i will post a part of php mysql script below
please debug it.. when i execute it, it shows
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 ')' at line 1


the script is


$shopt = "SELECT price, SUM(price) FROM shop where sold ='sold' ";
$shoptt = mysql_query($shop) or die(mysql_error());
$shoprow = mysql_fetch_array($shoptt) ;
$shopvalue= $shoprow['SUM(price)'];

$shopp="INSERT INTO payments(shop, totalprice) values ('shop',$shop) ";



mysql_query ($shopp) or die(mysql_error()) ;
echo "test success";
a mistake
in the second linee
its $shoptt =mysql_query($shopt) or die......
nd in the last line its

$shopp="INSERT INTO payments(shop, totalprice) values ('shop',$shopvalue) ";
 
Back
Top