<snip>
        }else if(!$submit){
</snip>

Acthough you didn't show 75 lines of code my guess would be your problem
lies here.  The else and the if shouldn't have a space between them.

        } elseif(!$submit){

See how that works for you =)

Also your SQL is faulty

<snip>
$sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE booktitle=$booktitle
AND quantity=quantity";
</snip>

$booktitle I'm 99.9% certain is not an integer.  Therefore you need single
quotes around it.  And the condition quantity=quantity is a tad redundant
since quantity would always equal itself =)  I suspect you meant
quantity=$quantity (again if it's not an integer you need single
quotes....heck put single quotes around it anyways...it doesn't hurt)

$sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE
booktitle='$booktitle' AND quantity='$quantity'";

Sincerely,

Craig Vincent



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to