Hello!
From the title you can tell I am a complete newbie.
I've got a simple blog and I am trying to integrate a gallery. The idea is to display six sample pics on my index page. Clicking on any of them moves the visitor to gallery page. I wrote this but the error reads following:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
<?php
$db = mysql_connect("mysql0.someserver.com", "db_user", "db_password");
mysql_select_db("db_name",$db);
$sql = "select * from table_where_I_store_pics order by imageid desc limit 6";
$result = mysql_query($sql ,$db);
if
($myrow = mysql_fetch_array($result)) {
do {
printf("<tr>");
printf("<td align=center><font size=2 face='tahoma'>
<a href=gallery.php><img src=%s></a></font></td>",
$myrow["thumbpath"]);
printf("</tr>");
}
while ($myrow = mysql_fetch_array($result));
}
?>
Good luck all and help me with some hint!
Please do not comment on my printfs. I moved to PHP from another language. I know... I'll soon switch to echo.