Jump to content

show uploaded files name from database


Jaswinder

Recommended Posts

<div style="width:100%; height:auto; background-color:#000; color:#FFF; text-align:center;">
 <table align="center" width="100%" border="1" style="color:#FFF;">
 <tr><th>Pdf</th><th>Video</th><th>Images</th></tr>
<?php
$email=$_GET['email'];
include_once ('host.php');
$c="select * from upload where email_id=$email";
$sq=mysql_query($c) or die(mysql_error());
$r=mysql_num_rows($sq);
if($r>=0)
{
    while($f=mysql_fetch_array($sq));
    {?>
   
    
    <tr><td><? echo $f['pdf']; ?></td><td><? echo $f['video']; ?></td><td><? echo $f['images']; ?></td></tr>
 
    <?php
    }
}
else
    {
        echo "You do not uploaded anything yet";    
    }
    
?>
<tr><td colspan="3" style="background-color:#F00;"><a href="upload.php">Back</a></td></tr>
</table>
</div>

 

 

error

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@s.com' at line 1

                                 

                                       Pdf                                        Video                                       Images

 

 

Where email id is a@s.com

Link to comment
https://forums.phpfreaks.com/topic/278419-show-uploaded-files-name-from-database/
Share on other sites

In that case, I would create another table where you insert the images by whichever user, but you also insert a unique id of that user at the same time. This will allow you to select only the images with that certain id.

 

Kind regards,

 

L2c.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.