Computing.Net > Forums > Database > SQL Errors

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SQL Errors

Reply to Message Icon

Name: macaveli
Date: January 20, 2007 at 08:17:04 Pacific
OS: XP
CPU/Ram: Intel R M processor 1.73G
Product: 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);?>



Sponsored Link
Ads by Google

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

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);
?>



0

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

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


0

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

thanks for reply :)
it helped me

software reviews


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







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


Sponsored links

Ads by Google


Results for: SQL Errors

SQL Server Errors www.computing.net/answers/dbase/sql-server-errors/421.html

SQL Server Reporting Services www.computing.net/answers/dbase/sql-server-reporting-services/722.html

Installing SQL version over trial www.computing.net/answers/dbase/installing-sql-version-over-trial/266.html