> mysql_select_db( $db, $link ) > > or die ( "Couldn't open the $db: ".mysql_error() ); > > > if ($submit){ > > if( $booktitle AND "quantity" ){ > > $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE > booktitle='$booktitle' AND quantity=quantity"; > > }
Easy enough =) You're not running the mysql query =) You're never sending a command to MySQL to tell it to execute the $sql statement if( $booktitle AND "quantity" ){ $sql = "UPDATE Book2 SET stock ='$stock-quantity' WHERE booktitle='$booktitle' AND quantity=quantity"; mysql_query($sql); } Should do the trick. Or even cleaner if( $booktitle AND "quantity" ){ mysql_query("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