php-db | 2001072
Date: 07/24/01
- Next message: Fernando Gonzalez: "[PHP-DB] Problem with my first script"
- Previous message: Matt Nigh: "[PHP-DB] another php/mysql problem"
- In reply to: tony: "[PHP-DB] php script showing up on web page!!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Well unless you set up your webserver to parse .htm pages then your code
will not be parsed and is displayed as plain text.
-- phill"Tony" <tony777 <email protected>> wrote in message news:20010724205428.75944.qmail <email protected> > Here is the link to the problem page, > http://www.youngsmall.com/cgi-local/shop.pl/page=index222.htm > > This PHP script shows up below "buy now" button. > Can anybody tell me what I am doing wrong? > This is script that I am using on each buy buttons, > <?php > $link = mysql_connect("xxxxx","xxxxxx","xxxxxx") > or die ("Could not connect"); > > if (! <email protected>("xxxxx") ) { > echo( "<P>Unable to locate the inventory " . > "database at this time.</P>" ); > exit();} > > $itemx = "6505"; > $sql = "SELECT quantity FROM inventory WHERE item = '$itemx'"; > $result = mysql_query($sql,$link); > $row = mysql_fetch_array($result); > // you have to fetch the result into an array to access the info in the db > $num = $row["quantity"]; > > // NOW we can compare $num ;) > if ($num < 1) { > echo "<b><font color=\"#FF0000\">Out of Stock</font></b>"; > } else { > echo "<b><font color=\"#0000FF\">In Stock</font></b>"; > } > mysql_close($link); > > ?> > > Thanks for your time. > Tony > > > >
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Fernando Gonzalez: "[PHP-DB] Problem with my first script"
- Previous message: Matt Nigh: "[PHP-DB] another php/mysql problem"
- In reply to: tony: "[PHP-DB] php script showing up on web page!!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

