Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

PHP/Smarty problem - Calling data from MySQL database

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #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
  #2  
Old 02-20-2004, 06:54 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

try $desc["description"]
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 02-20-2004, 08:37 AM
 
toby5482 toby5482 is offline
 

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

Default

I got it working another way. I think that would work though. Thanks
__________________
Version 3.4.5
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 04:27 AM.

   

 
X-Cart forums © 2001-2020