View Single Post
  #1 (permalink)  
Old 07-03-09, 09:08 AM
xEX3CUT1ONx xEX3CUT1ONx is offline
Newbie Coder
 
Join Date: Jun 2008
Posts: 96
Thanks: 0
Thanked 0 Times in 0 Posts
mysql fetch error

Hello, I'm currently working on an upload area for members of a site, so far I have it so that when a file is uploaded it adds the file name into the database along with the user who submitted it.

Now I am trying to get it so that it will list all of the files that are uploaded by the username that is registered in the current session.

My code for this part is :

PHP Code:
echo"<table id='upload_table' width='500px' id='uploaded_table'><tr>
<th align='left' id='id_upload'>ID</th>
<th align='left' id='file_upload'>File Name</th>
</tr>"
;
    
    
$fetch_files mysql_query("SELECT * FROM 'uploaded' WHERE submit_user = $curr_user ORDER BY ID");
    while(list(
$ID,$filename)=mysql_fetch_row($fetch_files)){
    
    echo
"<tr>
<td width='5%'>$ID</td>
<td><a href='$target_path$filename' target='_blank'>$filename</a></td>
<td width='5%'><form action='delete.php' method='post'><input type='hidden' name='delete' value='$ID'><input type='submit' id='delete_upload' name='submit' value='Delete'></form></td>
</tr>"
;
}
echo
"</table>";
    

I cannot see where the error is, but the error I am getting is:

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\upload_members.php on line 87, Line 87 is

PHP Code:
while(list($ID,$filename)=mysql_fetch_row($fetch_files)){ 
Reply With Quote