pp4sale
11-04-2007, 12:37 PM
I have been tying to use php to create alt tags that pull data from a mysql database. So for instance the alt tag could show the region, price and country etc by pulling that info from a table.
This is what I have currently:
if(!empty($a1[image]))
{
$im_array = explode("|", $a1[image]);
//$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100>";
$FirstImage = "<img src=\"thumbnails/$im_array[0]\">";
Should it be something like:
//$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100>";
$FirstImage = '<img src=\"thumbnails/$im_array[0]\alt="'.$a1['region'].', '.$a1['country'].'">";
But with this i get this error :
Parse error: syntax error, unexpected T_LNUMBER
on this line:
if($i == '2')
{
$Image2 = "bg_photos2.gif";
if(!empty($a1[image]))
{
$MyImages = explode("|", $a1[image]);
Any one know why?
This is what I have currently:
if(!empty($a1[image]))
{
$im_array = explode("|", $a1[image]);
//$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100>";
$FirstImage = "<img src=\"thumbnails/$im_array[0]\">";
Should it be something like:
//$FirstImage = "<img src=\"re_images/$im_array[0]\" width=100 height=100>";
$FirstImage = '<img src=\"thumbnails/$im_array[0]\alt="'.$a1['region'].', '.$a1['country'].'">";
But with this i get this error :
Parse error: syntax error, unexpected T_LNUMBER
on this line:
if($i == '2')
{
$Image2 = "bg_photos2.gif";
if(!empty($a1[image]))
{
$MyImages = explode("|", $a1[image]);
Any one know why?