0

this is my html code in which i want to get info from the server and insert it into the list items and show it in the browser, using loop .so i am using php but this code is not working for me . please somebody help me !!!!!!!!!

<body>

<div class="infiniteCarousel">
<div class="wrapper" style="overflow: hidden;">
<ul>
<?php
// Connects to your Database 
 mysql_connect("localhost", "root", "") or die(mysql_error()) ; 
 mysql_select_db("a") or die(mysql_error()) ; 
 
 //Retrieves data from MySQL 
 $data = mysql_query("SELECT * FROM employees") or die(mysql_error()); 
 //Puts it into an array 
 while($info = mysql_fetch_array( $data )) 
 { 
?>
<li > 
<?php 
 Echo "<img width="240" height="240" alt="Wonky Buildings"  src=images/".$info

['photo'] ."> ";  // this part is not working 
?>

</li>
<?php   } ?>

</ul>
</div>
<a class="arrow back">&lt;</a>
<a class="arrow forward">&gt;</a>
</div>


</body>

i am getting this syntax error

Parse error: syntax error, unexpected T_LNUMBER, expecting ',' or ';'

Edited by aaloo: n/a

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by aaloo
1

The problem is related to the double quotes, rewrite that line 19:

$img = $info['photo'];
echo '<img width="240" height="240" alt="Wonky Buildings"  src="images/'. $img .'>';

Or:

echo "<img width=\"240\" height=\"240\" alt=\"Wonky Buildings\" src=\"images/".$img ."\">";

Or:

echo "<img width='240' height='240' alt='Wonky Buildings' src='images/$img'>";

bye

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.