arturo
April 15, 2006, 4:05pm
1
Hi there, I’m tryint to call an image if the image row is empty in the database, if not, call the image route sotred in the data base I’m using this
<?php
if ($row_rsDetails[‘RestaurantLogo’]=="" || $row_rsDetails[‘RestaurantLogo’] == NULL)
echo “<img src=images/logos/nologo.gif>”;
else
echo “<img src=“echo $row_rsDetails[‘RestaurantLogo’];”>”;
?>
but I get this
Parse error : parse error, expecting ','' or
‘;’’ in /Library/WebServer/Documents/mark/details.php on line **33
**line 33 is echo “<img src=“echo $row_rsDetails[‘RestaurantLogo’];”>”;
what am I doing wrong?
Thanks guys
Arturo
Ankou
April 15, 2006, 4:23pm
2
echo "<img src="echo $row_rsDetails['RestaurantLogo'];">";
When you use double quotes inside double quotes (or single quotes inside single quotes) you need to delimit the quotes that you wish to display.
So you like could look like:
echo "<img src=\"$row_rsDetails['RestaurantLogo']\">";
Or:
echo '<img src="' . $row_rsDetails['RestaurantLogo'] . '">';
arturo
April 15, 2006, 4:27pm
3
Ankou:
echo "<img src="echo $row_rsDetails['RestaurantLogo'];">";
When you use double quotes inside double quotes (or single quotes inside single quotes) you need to delimit the quotes that you wish to display.
So you like could look like:
echo "<img src=\"$row_rsDetails['RestaurantLogo']\">";
Or:
echo '<img src="' . $row_rsDetails['RestaurantLogo'] . '">';
thanks a lot, many thanks!!, just one thing, how I can place the size of the image? because my image is kinda’ big I’ll like to place something like 80x53 pxls, my code now is
<?php
if ($row_rsDetails[‘RestaurantLogo’]==“” || $row_rsDetails[‘RestaurantLogo’] == NULL)
echo “<img src=images/logos/nologo.gif>”;
else
echo ‘<img src="’ . $row_rsDetails[‘RestaurantLogo’] . ‘">’;
?>
thanks Ankou
bwh2
April 15, 2006, 7:47pm
4
are you basiclaly looking to resize the large image or are you going to make a separate thumbnail file? i would recommend making a thumbnail over resizing the large image b/c you will cut down on bandwidth drastically.
arturo
April 15, 2006, 7:54pm
5
oh no, my image is 150x100 but that page is a search detail so I need the image reduced in order to fit in the page to 80x53, I know there’s a way to place the size in the img tag, but don’t know how to do this with this treatment but is not working:
<?php
if ($row_rsDetails[‘RestaurantLogo’]==“” || $row_rsDetails[‘RestaurantLogo’] == NULL)
echo “<img src=images/logos/nologo.gif>”;
else
echo ‘<img src="’ . $row_rsDetails[‘RestaurantLogo’] . ‘" width=“80” height=“53”>’;
?>
thanks a lot!!
bwh2
April 15, 2006, 8:05pm
6
echo '<img src="' . $row_rsDetails['RestaurantLogo'] . '" width="80" height="53">';
^this should work. are you getting an error message or what is the screen displaying that lets you know it’s not working?
hl1
April 15, 2006, 8:07pm
7
arturo:
oh no, my image is 150x100 but that page is a search detail so I need the image reduced in order to fit in the page to 80x53, I know there’s a way to place the size in the img tag, but don’t know how to do this with this treatment but is not working:
<?php
if ($row_rsDetails[‘RestaurantLogo’]==“” || $row_rsDetails[‘RestaurantLogo’] == NULL)
echo “<img src=images/logos/nologo.gif>”;
else
echo ‘<img src="’ . $row_rsDetails[‘RestaurantLogo’] . ‘" width=“80” height=“53”>’;
?>
thanks a lot!!
<?php
if ($row_rsDetails['RestaurantLogo']=="" || $row_rsDetails['RestaurantLogo'] == NULL){
echo "<img src=images/logos/nologo.gif>";
}
else{
echo '<img src="' . $row_rsDetails['RestaurantLogo'] . '" width="80" height="53">';
}
?>
bwh2
April 15, 2006, 8:11pm
8
btw arturo, you should use the [noparse]
here's my php code
[/noparse] tags so that your code is sectioned off and color coded.
arturo
April 15, 2006, 8:14pm
9
bwh2:
btw arturo, you should use the [noparse]
here's my php code
[/noparse] tags so that your code is sectioned off and color coded.
hi there, well, I’m not getting any error, but the image it’s at full size
(-:
bwh2
April 15, 2006, 8:17pm
10
when you view the resulting html, what is the output?
arturo
April 15, 2006, 8:25pm
11
check this
www.videoestudio.net/mark
then click on West Palm Beach button
Thanks bwh2!