cdog1912 Posted April 3, 2009 Share Posted April 3, 2009 here's the code im trying to retrive image which have their paths stored in a mysql database. The code: <?php include'config.php'; include'opendb.php'; $row_count = 0; $row_ttl = 4; // this is used to make your rows scalable echo "<table width='100%'><tr align='center'>"; $result = mysql_query("SELECT id, path FROM gallery1"); while ($row = mysql_fetch_array($result)) { $img_id = $row["id"]; $img_path = $row["path"]; echo "<td><a herf='$img_path'><img src='$img_path' width='150' height='250'></a></td>"; $row_count++; if ($row_count == $row_ttl) { echo "</tr><tr align='center'>"; $row_count -= $row_ttl; // cheesy way of resetting the counter } } echo "</tr></table>"; include'closedb.php'; ?> any help would be great Link to comment https://forums.phpfreaks.com/topic/152330-not-vaild-mysql-result-resource-problem-can-you-help/ Share on other sites More sharing options...
xtopolis Posted April 3, 2009 Share Posted April 3, 2009 not vaild mysql result resource problem Usually means the mysql connection didn't work, or the query failed. Test your query: mysql_query("SELECT id, path FROM gallery1"); in your mysql console/phpmyadmin Then test your database connection in these files: include'config.php'; include'opendb.php'; Let us know. Link to comment https://forums.phpfreaks.com/topic/152330-not-vaild-mysql-result-resource-problem-can-you-help/#findComment-800038 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.