I don't see variable $newname2 getting a value.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
Do you have these files on a server so that we can check the output ? Because, I don't understand what exactly is the problem..
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
I checked it and this is what I find.
http://acmeart.co.uk/mercury/image/thumbs/thumb_1207128520.jpg all the images have the same path. That is why the image is being repeated. While fetching the path from the table, check if it returns the right path. Then, there are only 2 input type='file'. So whenever you upload an image and then another (using the same upload file tag) it gets replaced.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
the type=file part of the form does this not mean that this is a browse button i have not changed this yet but if i put[icode]type=file1[/code] would the file browse button still appear?
i will check and get back
No. Not that. name="uploadimage1"> This one.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
$sql="UPDATE images_tab SET tab1='$tab1name2'";
You are updating all the records to tab1name. Have a where clause and update only 1 record. Since you are updating all records, it shows the same image in the preview page.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
if the code works for the images_broad table why will this not work for the new tables that have been created.
because there is nothing stored in the table before this code was run should i use the insert into query so that the table gets populated at least once and then change it to update.
Exactly ! You have to insert a record to the table in order to update it. And again, dont update all the records, but only one record.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
When you upload a path, a new row is inserted and the "path" is stored in a column. But when you update the table(without a where clause), it updates all the rows and replace all the path values stored in the column with the new value. So, You should have a where clause while using update.
nav33n
Purple hazed!
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356