I could really use some help on this problem i can't get around....and with my limited knowledge of mysql this is causing some problems
Ok i guess i should start off with what i'm trying to do. I have made a file uploader. Now what i want to do is when the user ventures to the upload area it shows them a link for each uploaded file. Also i should mention the script is being run from within vb...so it is using vb's db.
Here's what i currently have
PHP Code:
$showpic = $DB_site->query("SELECT uploadname FROM user ORDER BY uploadname DESC");
$picname = $DB_site->fetch_array($showpic);
$upload_bits="";
$piccount = $DB_site->num_rows($showpic);
if ($piccount == 0) {
eval ("\$upload_bits .= \"".gettemplate("upload_none")."\";");
} else {
eval ("\$upload_bits .= \"".gettemplate("upload_isthere")."\";");
}
uploadname is a column i have added to the users table. Upload_none template says there are no pics...and the Upload_isthere template is supposed to show the links
once an image is uploaded this is the query i'm using
PHP Code:
$DB_site->query("INSERT INTO user (uploadname) VALUES ('$imname')");
$imname is $_FILES['userfile']['name']
Upload_isthere looks like this
PHP Code:
<a href="$shorturl/$picname[uploadname]">$shorturl/$picname[uploadname]</a>
As it is right now...it only shows the file that was last uploaded...nothing more..even though there are 2 images in the db
So my question is how do i get it to display all of the images uploaded?
Also how do i get it so it only shows the pics uploaded by that person only?
I really appreciate any help...since this is my first hack from scratch and i'm really lost :P