bob_the _builder Posted March 14, 2007 Share Posted March 14, 2007 Hi, I have a form layed out like so to upload photos and input the file name into the database. while($counter <= $nof){ echo '<div class="editpage"> <label>Photo '.($counter+1).' Title</label> <input type="text" name="photo1alt[]" value="'.$myrow["photo1alt"].'" size="50" /><p /> <label>Change Photo '.($counter+1).'</label> <input type="file" name="photo_filename[]" size="37" /> </div><p />'; $counter++; } Im not to sure how to break that up to insert into the database like so .. $sql = mysql_query("UPDATE mypage SET photo1alt = '$photo1alt', photo1 = '$photo1', photo2alt = '$photo2alt', photo2 = '$photo2', photo3alt = '$photo3alt', photo3 = '$photo3', photo4alt = '$photo4alt', photo4 = '$photo4', photo5alt = '$photo5alt', photo5 = '$photo5' WHERE userid='$userid'"); ? Thanks Link to comment https://forums.phpfreaks.com/topic/42623-inserting-an-array-of-photos-into-database/ Share on other sites More sharing options...
ridiculous Posted March 14, 2007 Share Posted March 14, 2007 God that's a really good question Bob. I don't have the answer, but what I will say is that I'm listening to Foreigner right now and their song "Urgent" rocks. So hard. Link to comment https://forums.phpfreaks.com/topic/42623-inserting-an-array-of-photos-into-database/#findComment-206834 Share on other sites More sharing options...
bob_the _builder Posted March 14, 2007 Author Share Posted March 14, 2007 Im guessin I can use explode function, but im not sure what the delimiter would be with such an array.. Thanks Link to comment https://forums.phpfreaks.com/topic/42623-inserting-an-array-of-photos-into-database/#findComment-206849 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.