Jump to content

Variable Presentation


user4fun

Recommended Posts

This method works

$Website="www.mydomain.com";$Llink="image/myimage.jpg";echo '<td><img src="http://' . $Website ."/". $Llink.'" width="50" height="30" /></td>';

The exact Same Code (kinda) does not work. Why?

while($row = mysql_fetch_array($result))  {$Website=$row['website'];$Lline=$row['Lline'];echo '<td><img src="http://' . $Website .'/'. $Lline.'" width="50" height="30" /></td>';

The Second codes read the $row['Website'] value and it ignores the $row['Lline']What is the difference and why does the second one not work?

Link to comment
Share on other sites

as I can see you are not careful with variable names, at some place they are uppercase, somwhere else lowercasecheck the columun in name in database at this line$Lline=$row['Lline'];What is the columun name Lline or lline?

Link to comment
Share on other sites

The second piece of code is working just fine, PHP won't just ignore data. If it's coming out blank, then the value in the database is blank. You can use print_r($row) to see the values of all fields.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...