trying to display image from database. last image to 1st.
but getting error:
Warning: mysql_query() expects parameter 1 to be string, resource given in C:\xampp\htdocs\a_upload\gallery.php on line 12
Warning: mysql_fetch_assoc() expects parameter 1 to be resource, null given in C:\xampp\htdocs\a_upload\gallery.php on line 26
$sql = mysql_query("SELECT * FROM image WHERE user_id = $id");
$result = mysql_query($sql); //get access to image table
while($row = mysql_fetch_assoc($result))
{
echo"<td> ";
$image_db = $row['image'];
$src = "data:image/gif;base64," . $image_db;
echo" <img src=\"$src\" width='130px' height='130px' class='image_p' />";
echo"</td>";
$count++;
if($count == 5) //5 rows
{
echo "</tr><tr>"; // Start a new row at 6 cells
$count = 0;
}
}