Benan Posted September 28, 2006 Share Posted September 28, 2006 hi, Im running a script called 0day DB, and im just confgiruing everything..When I went to "Submitted downloads" page in my Admin Control Panel, I got an SQL error saying:[quote]Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/freddy/public_html/acp/submitted.php on line 81Page:Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/freddy/public_html/acp/submitted.php on line 67[/quote]Here is the code to that page:[code]<? require('access.php'); ?><link rel="stylesheet" type="text/css" href="images/0daydb.css" /> <title>0DayDB Admin Control Panel</title> <style type="text/css"><!--.style3 {font-size: 12px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;}.style4 {font-size: 10px}.style7 {font-family: Verdana, Arial, Helvetica, sans-serif}.style8 {color: #000000}--> </style><div align="center"> <table class="border" width="81%"> <tr> <td width="20%" valign="top" align="left"> <div class="border"> <div class="title">:: Navigation</div> <div class="sex"> <div align="left"><strong>» Main</strong><br> » <a href="../index.php">Site Home</a><br> » <a href="admin.php">Admin Home</a><br> » <a href="http://d0xscripts.com/viewforum.php?f=12">Support</a><br> <br> <strong>» Downloads</strong><br> » <a href="submit.php">Submit Downloads</a><br> » <a href="remove.php">Remove Downloads</a><br> » <a href="submitted.php">Submitted Downloads </a><br> <br> <strong>» Tools</strong><br> » <a href="auto.php">AutoSubmitter</a><br> » <a href="ban.php">Ban IPs</a><br> » <a href="stats.php">Site Stats</a><br> » <a href="multiup.php">Multi Upload</a><br> <br> <strong>» News</strong><br> » <a href="addnews.php">Add News</a><br> » <a href="removenews.php">Remove News</a></div> </div> </div> </td> <td width="80%" valign="top"> <div class="border"> <div class="title">:: Submitted</div> <div class="sex"> <div align="justify">these are the downloads that guests have submitted to your site! you must cllck the download and find the file info of the item that has been added. enjoy!<br> <br> Notice: for the next version we will make it so you can just submit them strate into your download list from here. <br> </div> </div> </div> <div class="border"> <div class="title">:: Submitted Downloads </div> <div class="sex"> <?include("../dbconnect.php"); if(!$_GET[page]) $_GET[page]=1;$start = ($_GET[page]-1)*$limit;function pagelinks($ispage=1,$getme = "order by id DESC"){global $limit; $indb = mysql_numrows(mysql_query("SELECT * FROM guestsubmit $getme")); $pagenumber = $indb / $limit; $pagenumber++; $pagecnt=1; while($pagecnt <= $pagenumber) { if($pagecnt == $ispage){echo "[ $pagecnt ] ";} else{echo "<a href=\"submitted.php?page=$pagecnt\" target=_self>$pagecnt</a>\n ";} $pagecnt++; }}$result = mysql_query("select * from guestsubmit order by id DESC limit $start,$limit");while($r=mysql_fetch_array($result)){ $id=$r["id"]; $title=$r["title"]; $date=$r["date"]; $description=$r["description"]; $link=$r["link"]; //display the rowecho ("<a href='dl.php?id=$id'>$title</a><br>");}echo"<br>Page: \n";pagelinks($_GET[page]);?> </div> </div></td> </tr> </table> Powered By <strong><a href="http://www.d0xscripts.com">0DayDB v2.3</a></strong></div>[/code][b]while($r=mysql_fetch_array($result))[/b] [i][b]<- Page 81[/b][/i][b]$indb = mysql_numrows(mysql_query("SELECT * FROM guestsubmit $getme"));[/b] [i][b]<- Page 67[/b][/i]Can some one please help me out here? Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/ Share on other sites More sharing options...
AndyB Posted September 28, 2006 Share Posted September 28, 2006 Try replacing this:[code]$indb = mysql_numrows(mysql_query("SELECT * FROM guestsubmit $getme"));[/code]With this:[code]$query = "SELECT * from guestsubmit ". $getme;$result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); // what went wrong?$indb = mysql_numrows($result);[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/#findComment-100005 Share on other sites More sharing options...
Benan Posted September 28, 2006 Author Share Posted September 28, 2006 Done that and i get this now:Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/freddy/public_html/acp/submitted.php on line 83Page: Error: Table 'freddy_ddl.guestsubmit' doesn't exist with query SELECT * from guestsubmit order by id DESC Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/#findComment-100022 Share on other sites More sharing options...
Gaoshan Posted September 28, 2006 Share Posted September 28, 2006 The table you are trying to query simply doesn't exist. Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/#findComment-100064 Share on other sites More sharing options...
Benan Posted September 28, 2006 Author Share Posted September 28, 2006 How do I fix it Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/#findComment-100450 Share on other sites More sharing options...
Gaoshan Posted September 28, 2006 Share Posted September 28, 2006 You either have to create the table and populate it with the data you need or you have to figure out which table the script is supposed to be pointing at and change the name to that table. As for how to do that, I recommend reading this: [url=http://dev.mysql.com/doc/refman/4.1/en/index.html]http://dev.mysql.com/doc/refman/4.1/en/index.html[/url] Quote Link to comment https://forums.phpfreaks.com/topic/22324-sql-error-help/#findComment-100456 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.