View Single Post
  #1  
Old 02-19-2004, 08:59 AM
 
toby5482 toby5482 is offline
 

Advanced Member
  
Join Date: Sep 2003
Location: UK
Posts: 34
 

Default PHP/Smarty problem - Calling data from MySQL database

I'm trying to create a php file to call the description field from the categories table. Does anyone know what is wrong with the below code:

Quote:
function categorydesc($id) {
$id = array();
$query = "SELECT description FROM xcart_categories WHERE categoryid='$id'";
$result = mysql_query($query);
while ($desc = mysql_fetch_array($result));
{
print "Decription: $desc

";
}}
categorydesc(12)
?>

It displays "Description: " and then nothing.
__________________
Version 3.4.5
Reply With Quote