Jump to content

[SOLVED] a mysql_fetch error using php


chriscloyd

Recommended Posts

heres my error

[quote]Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/srxstud/public_html/test22/includes/liveprojects.php on line 7
[/quote]
heres my code

[code]<?php
$get_num_project = mysql_query("SELECT * FROM projects WHERE status = 'Completed'");
$num_project = mysql_num_rows($get_num_project);
$maxlimit = rand(1,$num_project);
$minlimit = $maxlimit - 5;
$project_get = mysql_query("SELECT * FROM projects WHERE status = 'Completed' LIMIT '$minlimit','$maxlimit'");
while ($p = mysql_fetch_assoc($project_get)) {
echo '<table width="95%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="85%">'.$p['title'].'</td>
    <td align="center" width="15%"><a href=portfolio.php?project='.$p['id'].'">View</a></td>
  </tr>
</table>';
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/35964-solved-a-mysql_fetch-error-using-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.