Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.0How 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);?>

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

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 :)

![]() |
![]() |
![]() |

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