473,395 Members | 2,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Having problems with my download script

I got a few errors with this script

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/starfi3ld/domains/starfi3ld.com/public_html/newreleases.php on line 15

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/starfi3ld/domains/starfi3ld.com/public_html/newreleases.php on line 70

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/starfi3ld/domains/starfi3ld.com/public_html/newreleases.php on line 73

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. include("header.php");
  4.  
  5. define('IN_PHPBB', true);
  6. $phpbb_root_path = 'Forum/';
  7. include($phpbb_root_path . 'extension.inc');
  8. include($phpbb_root_path . 'common.'.$phpEx);
  9. $userdata = session_pagestart($user_ip, PAGE_INDEX);
  10. init_userprefs($userdata);
  11.  
  12. if ($userdata['session_user_id'] != "") {
  13.     $qry = "select access_level from list_users where user_id=".$userdata['session_user_id'];
  14.     $result = mysql_query($qry,$dbi);
  15.     if (mysql_num_rows($result) > 0) {
  16.         list($acclvl) = mysql_fetch_row($result);
  17.         $path = "/donators";
  18.     } else {
  19.         $acclvl = "1";
  20.         $path = "/users";
  21.     }
  22. } else {
  23.     $acclvl = "1";
  24.     $path = "/users";
  25. }
  26.  
  27. if ($_GET['mode'] == "list") {
  28.     $qry = "select distinct date(file_date) from list_anime where access_level<=$acclvl order by file_date desc";
  29.     $result = mysql_query($qry,$dbi);
  30.     $numrows = mysql_num_rows($result);
  31.     echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
  32.         ."<tr><td></td></tr>\n";
  33.     for ($i=0;$i<$numrows;$i++) {
  34.         list($lstdate) = mysql_fetch_row($result);
  35.         $lstdatecust = dateconvert($lstdate);
  36.         echo "<tr><td nowrap>"
  37.             ."<strong>:&middot;</strong>&nbsp;<a href=\"newreleases.php?mode=date&amp;datepick=".substr($lstdate,0,12)."\">".substr($lstdatecust,0,12)."</a>"
  38.             ."</td></tr>\n";
  39.     }
  40.     echo "</table>\n";
  41. } elseif ($_GET['mode'] == "date") {
  42.     $datepick = $_GET['datepick'];
  43.     $qry = "select id,file_name,server,location from list_anime where access_level<=$acclvl and file_date like '$datepick%' order by file_name asc";
  44.     $result = mysql_query($qry,$dbi);
  45.     $numrows = mysql_num_rows($result);
  46.     $datepick = dateconvert($datepick);
  47.     if ($numrows != 0) {
  48.         echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
  49.             ."<tr><td style=\"border-bottom-style:inset; border-bottom-width:thin; border-top-color:#FFFFFF\">".substr($datepick,0,12)."</td></tr>\n"
  50.             ."<tr><td></td></tr>\n";
  51.         for ($i=0;$i<$numrows;$i++) {
  52.             list($id,$file,$svr,$loc) = mysql_fetch_row($result);
  53.             if (eregi("backup",$loc)) {
  54.                 $mdir = "anime2";
  55.             } else {
  56.                 $mdir = "anime";
  57.             }
  58.             $lnk = base64_encode($file."|".$loc."|".$mdir);
  59.             echo "<tr><td nowrap>"
  60.                 ."<strong>:&middot;</strong>&nbsp;<a href=\"".$svr.$path."/getfile.php?fileid=$id&amp;lnk=$lnk\">$file</a>"
  61.                 ."</td></tr>\n";
  62.         }
  63.         echo "</table>\n";
  64.     }
  65.     echo "<br><br>\n<div align=\"right\"><a href=\"newreleases.php?mode=list\">Archives</a></div>\n";
  66. } else {
  67.     //list file based on latest entry date
  68.     $qry = "select file_date from list_anime where access_level<=$acclvl order by file_date desc";
  69.     $result = mysql_query($qry,$dbi);
  70. [/b]    list($latestdt) = mysql_fetch_row($result);
  71.     $qry = "select id,file_name,server,location from list_anime where access_level<=$acclvl and file_date like '".substr($latestdt,0,10)."%' order by file_name asc";
  72.     $result = mysql_query($qry,$dbi);
  73.     [b]$numrows = mysql_num_rows($result);
  74.     $latestdt = dateconvert($latestdt);
  75.     if ($numrows != 0) {
  76.         echo "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">\n"
  77.             ."<tr><td style=\"border-bottom-style:inset; border-bottom-width:thin; border-top-color:#FFFFFF\">Last update: $latestdt</td></tr>\n"
  78.             ."<tr><td></td></tr>\n";
  79.         for ($i=0;$i<$numrows;$i++) {
  80.             list($id,$file,$svr,$loc) = mysql_fetch_row($result);
  81.             if (eregi("backup",$loc)) {
  82.                 $mdir = "anime2";
  83.             } else {
  84.                 $mdir = "anime";
  85.             }
  86.             $lnk = base64_encode($file."|".$loc."|".$mdir);
  87.             echo "<tr><td nowrap>"
  88.                 ."<strong>:&middot;</strong>&nbsp;<a href=\"".$svr.$path."/getfile.php?fileid=$id&amp;lnk=$lnk\">$file</a>"
  89.                 ."</td></tr>\n";
  90.         }
  91.         echo "</table>\n";
  92.     }
  93.     echo "<br><br>\n<div align=\"right\"><a href=\"newreleases.php?mode=list\">Archives</a></div>\n";
  94. }
  95.  
  96. include("footer.php");
  97.  
  98. ?>
Can anyone help me with this? This is a new releases script connected to my downloads database... It is supposed to show the latest file entries and keep an archive of it... I'm not sure what i did wrong.... i'm using
Mysql Server version: 4.1.21-standard
and also Direct admin as my server CP
Apr 14 '07 #1
2 1863
erm adding to that, The scripts used to work until i transferred the site unto another server... So I'm quite confused now..

Line 15 is in bold

If you cant find line 70 and 73, search for
list($latestdt) = mysql_fetch_row($result); - Line 70

$numrows = mysql_num_rows($result); - Line 73
Apr 14 '07 #2
Motoma
3,237 Expert 2GB
You never called mysql_connect() to establish your database connection.
Apr 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Martin | last post by:
I have a PHP script that should be run a few times a day. Currently I run this script manually as I haven't been able to set up Lynx or wget to run it as a cronjob. Or to be more specific: the...
6
by: clintonG | last post by:
After the last six days trying to download VS2005 Professional it seems there may be a problem with my instance of the File Transfer Manager (FTM) or somewhere in the network in between. I can't...
0
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute with...
5
by: TB | last post by:
Hi All: This news group is proving to be great help on my path towards mastering ASP.NET thanks to all of you helpful souls out there. I am looking forward to the day when I can contribute...
2
by: Jan Paul van de Berg | last post by:
I have a piece of software that people can download and a third party promoting that software. In order for them to be able to count the number of downloads, I have to put a tracking code on my...
5
by: johnric | last post by:
I can't seem to get firefox to read the image size in my javascript. It will work in IE and firefox but firefox will not read the image size. Can anyone see the problem in my code? I am new to...
6
by: Pep | last post by:
Firstly, I'm not sure if this is the right group for this query, so please forgive me if I am wrong. My problem is that most users I distribute my software to cannot install it on their systems...
9
by: Tuy Solang | last post by:
I download four scripts that are used to display Khmer PGN for Khmer Chess. It works fine with Netscape 7.1 on MS Millenium, but it gave me an error(Java Script console) with Netscape 8.1 on MS...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.