samedi 29 mars 2014

Warning: mysql_num_rows() expects parameter 1 upload script


Vote count:

0




Hello i have a problem with my upload file scripts I have no idea how to fix it someone help me?


This code:



<?php

$sql="SELECT filename,user_id,filesize,id,dt FROM upload WHERE user_id ='".$userdata['user_id']."' order by id desc;";

$res = mysql_query($sql);

$ile = mysql_num_rows($res);

if($ile>0){

echo "<p style='font-weight:bold'>Liczba Twoich plików na serwerze to: $ile</p>";

while($p = mysql_fetch_object($res)){

echo "<p>";

echo "<span style='color:green;'>".date("Y-m-d H:i:s",$p->dt)."</span>&nbsp;&nbsp;Twój link: <input style='width:400px;' type='text' value='http://ift.tt/1fzGVd9' />&nbsp;&nbsp;<a href='http://ift.tt/1jkP4XG' target='_blank'>Kliknij aby pobrać</a>&nbsp;&nbsp;<a href='upload.php?del=$p->id''>Usuń</a>";

echo "</p>";

}

}else{

echo "<p>Nie posiadasz jeszcze żadnych plików na serwerze</p>";

}

?>


and output:



Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\Program Files (x86)\WebServ\httpd\ss\upload.php on line 223


Please help.



asked 2 mins ago






Aucun commentaire:

Enregistrer un commentaire