get mysql cell content
Posted: Fri Jun 22, 2007 2:43 pm
feyd | Please use
its work fine, but insted of $fileds[4]="location_stars"; that display a number 1-6 from the mysql query, i whant it to display an image
i try "<img src=../images/star_",$fileds[4],".gif/>"; but the result display images/star_location_stars.gif/; and i need it to display somthing loke this: if the location_stars cell content is 2= images/star_2.gif/;
thanks

feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello
this is a part of my php-mysql script :Code: Select all
$fileds[6]= "location_name";
$fileds[5]= "location_kategory";
$fileds[4]= "location_stars";
$fileds[3]= "location_area";
$fileds[2]= "location_city";
$fileds[1]= "location_telephone";
$fileds[0]= "location_mail";
while ($row = mysql_fetch_array($result))
{
echo "<TR>";
echo "<TD>",$row[$fileds[0]],"</TD><TD>",$row[$fileds[1]],"</TD><TD>",$row[$fileds[2]],"</TD><TD>",$row[$fileds[3]],"</TD><TD>",$row[$fileds[4]],"</TD><TD>",$row[$fileds[5]],"</TD><TD>",$row[$fileds[6]],"</TD>";
echo "</TR>";
}i try "<img src=../images/star_",$fileds[4],".gif/>"; but the result display images/star_location_stars.gif/; and i need it to display somthing loke this: if the location_stars cell content is 2= images/star_2.gif/;
thanks
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]