Perfect. That solution was right on. I had to make the id primary key auto increment to get past the duplicate value error from Sql.
Thank you for your help. Awesome!
User Profile
Collapse
-
Since the primary key in the Sql table is the Username, the subsequent images beyond the first do not get added to the table because Sql will not allow more than one Unique entry to the primary key. Nice what reading errors and warnings can trigger in the grey matter! :) So -- by adding a check at the beginning of the process to verify if the Username already exists in the table and if not create it and than removing the insert 'user' from line 145...Leave a comment:
-
Adding/changing line 145 with the above resulted in:
Query failed!
Duplicate entry 'Username' for key 1Leave a comment:
-
Thank you for your patience.
I added the error checking and found a warning on line 241, undefined constant assumed 'name'.
So I added $name=$row["name"]; in line 234 and changed line 241 to:
[code=php]echo "<td width='100'clas s='form_definit ions' height='100' align='center' valign='middle' ><img src ='../../models/".$username ."/".$name."_thumb nail.jpg' ><br><a href='uploa...Leave a comment:
-
multiple file upload to server and MySQL database
I've been working with this PHP page for several days now and I'm stumped. The page is supposed to allow the user to upload up to six images for their profile. When the user adds an image it (the page coding) does verify file size, if correct it places it on the server in the users folder and with the correct names and extension, creates the thumbnail and adds the correlating file name. However, it only adds the first file name to the database. When...
No activity results to display
Show More
Leave a comment: