PHP and MySQL
| From: | City Colleges of Chicago - Mannheim | Date: | Fri, 17 May 2002 13:57:20 +0000 |
| Subject: | PHP and MySQL | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98084@lists.php.net to get a copy of this message | ||
I just wanted to thank everyone for helping me with the script for my school
project. But, of course I must esp. thank JODY, (the man!!). Go ahead
Jody, eat up the glory! :)
Renee
Here is part of the script in its final form if anyone is interested:
<?track_vars?>
<?php
$user = "adminer";
$pass = "hoosiers";
$db = "Book Store1";
$local = "jolinux";
$link = mysql_connect( "$local", $user, $pass );
if (! $link )
die ( "Couldn't open the database" );
mysql_select_db( $db, $link )
or die ( "Couldn't open the $db: ".mysql_error() );
if(($booktitle) AND ($quantity) ){
$newstock= $Stock-$quantity;
$mysql = "UPDATE Book2 SET Stock =$newstock WHERE booktitle='$booktitle'";
// AND quantity=$quantity";
$result = mysql_query($mysql);
}
else
{
echo "Your order has not been placed.<p>";
}