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 !!!!!!!!!


<div class="infiniteCarousel">
<div class="wrapper" style="overflow: hidden;">
// 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 > 
 Echo "<img width="240" height="240" alt="Wonky Buildings"  src=images/".$info

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

<?php   } ?>

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


i am getting this syntax error

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

Recommended Answers

All 2 Replies

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 .'>';


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


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


thanks :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.