chriscloyd Posted January 30, 2007 Share Posted January 30, 2007 heres my error im gettingWarning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\includes\liveprojects.php on line 12heres the code i have[code]<?php$get_num_project = mysql_query("SELECT * FROM projects WHERE status = 'Completed'");$num_project = mysql_num_rows($get_num_project);if ($num_project <= 5) {$maxlimit = 5;$minlimit = 1;} else {$maxlimit = rand(6,$num_project);$minlimit = ($maxlimit - 5);}$project_get = mysql_query("SELECT * FROM projects WHERE status = 'Completed' LIMIT '$minlimit','$maxlimit'");while ($p = mysql_fetch_array($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=protfolio.php?project='.$p['id'].'">View</a></td> </tr> </table>';}?>[/code] Quote Link to comment Share on other sites More sharing options...
chronister Posted January 30, 2007 Share Posted January 30, 2007 [code]$project_get = mysql_query("SELECT * FROM projects WHERE status = 'Completed' LIMIT '$minlimit','$maxlimit'") or die(mysql_error());[/code]try that and see if any errors are occuring. I added the or die..... part. Quote Link to comment Share on other sites More sharing options...
chriscloyd Posted January 30, 2007 Author Share Posted January 30, 2007 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1','2'' at line 1 Quote Link to comment Share on other sites More sharing options...
chronister Posted January 30, 2007 Share Posted January 30, 2007 try this.[code]$project_get = mysql_query("SELECT * FROM projects WHERE status = 'Completed' LIMIT $minlimit,$maxlimit") or die(mysql_error());[/code]No quotes needed around the $minlimit, $maxlimit part Quote Link to comment Share on other sites More sharing options...
tauchai83 Posted January 30, 2007 Share Posted January 30, 2007 it could be the query problem if u got that kind of msg... Quote Link to comment Share on other sites More sharing options...
Orio Posted January 30, 2007 Share Posted January 30, 2007 You already opened a thread with this issue. I asked you try something but you never replied...Read what I told you.http://www.phpfreaks.com/forums/index.php/topic,124308.msg514803.htmlOrio. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.