My program is no longer giving a parse error, but my database is not being
updated (as far as the stock numbers are concerned). Any ideas???

I made the changes below per a few  people on the list:

<P>Quantity of books:<br>

<SELECT name = "quantity" size="1">

<OPTION value="1">1</OPTION>

<OPTION value="2">2</OPTION>

<OPTION value="3">3</OPTION>

<OPTION value="4">4</OPTION>

<OPTION value="5">5</OPTION>

<OPTION value="6">6</OPTION>

<OPTION value="7">7</OPTION>

<OPTION value="8">8</OPTION>

<OPTION value="9">9</OPTION>

<OPTION value="10">10</OPTION>

</SELECT>

<P>The book you are ordering:

<?

echo " $booktitle ";

?>

<P>Additional Message:<br>

<textarea name="message" cols=30 rows=3></textarea>

</p>

<INPUT type="submit" value="Send your order.">

<input type=hidden name="booktitle" value="<? print $booktitle; ?>">

</FORM>

<?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 ($submit){

if( $booktitle AND "quantity" ){

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

}

// $result = mysql_query($mysql);

}elseif(!$submit){

echo "Your order has not been placed.<p>";

}

?>

</BODY>

</HTML>

Renee

Reply via email to