[plug] Php again

SweenyTod sweenytod at sweenytod.com
Fri Aug 18 13:06:04 WST 2000


At 12:39 PM 18/08/2000, you wrote:
>Sorry to bother the list again, but i have yet another problem, im getting a
>parse error on line 4 of the following code
>
>Ive been looking at this code for 30 minutes now and i cannot see what is
>rong with the query.

Well the normal tricks at a time like this are to start commenting out the 
lines of code one by one until you find out which is causing the 
problem.  An error on one line might be the result of a syntax error on 
another earlier one.  (Anybody remember Cobol?  A missing '.' could cause a 
syntax error hundreds of lines later)

Failing that, check that you've not used a reserved word as a variable name...

Two quick hints.  :)

Good luck.



>Can someone help...its been a long day
>
><?
>         include("modules/orders/checkstatus.i");
>
>         $makeprice = "select * from productprice where code = '$code' ";
>         $execprice = mysql_query($makeprice, $connect);
>         $resultprice = mysql_fetch_array($execprice);
>         $price = $resultprice["price"];
>
>         $addproduct = "insert into orderitem(ordernum,code,price,qty) values
>($neworder,'$product',$price,$qty);
>
>         mysql_query($addproduct, $connect);
>
>         $checkupdate = "select * from orderitem where ordernum = 
> $neworder and code
>= '$code'";
>         $execupdate = mysql_query($checkupdate, $connect);
>
>         $resultupdate = mysql_num_rows($execupdate);
>
>         if ($resultupdate == 0) {
>                 echo("Item no added to order");
>         } else if ($resultupdate == 1) {
>                 echo("Item added to order successfully");
>         }
>
>?>



=============================================================
Attend the tale of Sweeney Todd.    His skin was pale and his eye was odd.
Always trust an Australian with a razor.

http://www.sweenytod.com               Paranoid is normal, normal is good




More information about the plug mailing list