X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   PHP/Smarty problem - Calling data from MySQL database (https://forum.x-cart.com/showthread.php?t=6314)

toby5482 02-19-2004 08:59 AM

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.

B00MER 02-20-2004 06:54 AM

try $desc["description"]

toby5482 02-20-2004 08:37 AM

I got it working another way. I think that would work though. Thanks


All times are GMT -8. The time now is 10:52 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.