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

Edited by Jaswinder
Link to comment
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.