Easy help needed..
I am querying my database to see if the record has an image. if it doesn't I want to show a white box. if it does have an image in the record, I want to show the image as shown below
<? $media_url = $db->get_sql_field("SELECT media_url FROM " . DB_PREFIX . "item_media WHERE item_id=" . $item_details['item_id'] . " AND
media_type=1 AND upload_in_progress=0 ORDER BY media_id ASC", 'media_url'); ?>
<? if (empty($media_url))
echo '<img src="/images/blank.png" height="100" width="100">';
echo '<img src="<?=SITE_PATH;?>thumbnail.php?pic=<?=$item_details['ad_image'];?>&w=350&sq=N&b=N border="0" alt="<?=$item_details['name'];?>">';
I get the following error. Any help would be greatly appreciated
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' at blah blah location line #128
Please use the php tags to post your code,
Open php using
- You use single quotes through that line so the outside quotes think you are closing them..
Something more like this is how it should look (untested)
|All times are GMT +1. The time now is 07:43 AM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.