Computing.Net > Forums > Database > SQL Errors

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

SQL Errors

Reply to Message Icon

Original Message
Name: macaveli
Date: January 20, 2007 at 08:17:04 Pacific
Subject: SQL Errors
OS: XP
CPU/Ram: Intel R M processor 1.73G
Model/Manufacturer: Dell XPS
Comment:

I am getting this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/regsim.100webspace.net/index.php on line 11
Wapuploader v1.0

How do I fix this?

Here's a copy of my index.php script

<?php
include 'config.php';

$nu = time();


$sql = ("SELECT * FROM wapupld_upload");
$result = mysql_query($sql, $db);
$enable = 0;

while($rs = mysql_fetch_array($result) ){
$uptime = $rs["dato"];
$idnm = $rs["idnm"];
$filname = $rs["filname"];

if(($nu-$uptime) >= $timeallowed) { // slet filen den er udløbet



unlink("tmpfiles/$filname");
$sql = ("DELETE FROM wapupld_upload WHERE idnm='$idnm'");
mysql_query($sql, $db);



}


}


?>


Wapuploader v1.0

<form enctype='multipart/form-data' action='<?php echo("$urltoindex");?>/uploadfile.php' method='post'>
<table cellspacing='2' cellpadding='2' border='0'>

<tr>
<td>

file: </td>
<td><input name='fil' type='file'></td>
</tr>
<tr>
<td>

file size limit: </td>
<td><?php $r = $allowedsize/1024; echo("$r kb");?></td>
</tr>

<tr>
<td><input name='submit' type='submit' value='Send File'> </td>
<td></td>

</tr>
<input type='hidden' name='from' value='tree'>
</table>
</form>
<?php checklic($license);?>


Report Offensive Message For Removal


Response Number 1
Name: srobert
Date: February 22, 2007 at 16:46:55 Pacific
Reply: (edit)

are you run mysql_connect and init $db ?

<?php
mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");

$result = mysql_query("SELECT id, name FROM mytable");

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf ("ID: %s Name: %s", $row[0], $row[1]);
}

mysql_free_result($result);
?>



Report Offensive Follow Up For Removal

Response Number 2
Name: JanetKellman
Date: July 9, 2007 at 13:28:18 Pacific
Reply: (edit)

at this line:
> include 'config.php';
you include some file, we don't see it. if you don't run mysql_connect in this file, do it :)

software reviews


Report Offensive Follow Up For Removal

Response Number 3
Name: JanetKellman
Date: November 5, 2007 at 10:41:03 Pacific
Reply: (edit)

thanks for reply :)
it helped me

software reviews


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge
Poll History




Data Recovery Software