daxguy Posted August 15, 2010 Share Posted August 15, 2010 $query1 = "select * from movies where title = '".$title."' ;"; $result1 = mysql_query($query1) or die('Could Not Execute The Query'); while ($row = mysql_fetch_assoc($result1) ) { for($f=0; $f<$parts[$current_k]; $f++ ) { touch("$base_folder/{$hos}/".$linking[$sum].".php"); $old_part_href = $row['href_parts']; $updated_part = $old_part_href.$new; $query_href = 'update movies set href_parts = \''.$updated_part.'\''; mysql_query($query_href) or die('COULD NOT EXECUTE THE QUERY FOR PARTS HREF'); $new = "{$base_folder}/{$hos}/".$linking[$sum].".php"; $sum++; } } what i am trying to do is take the value of href_parts and add the new href of the page to the existing value on the href_parts and update the href_parts field in my db.. but i am not getting the desired results.. all i am getting in the db is the last value that is passed in the loop in the db.. i want to save the values which are exisiting in the db and add the newly created values to itt.. can anyone help please.. Link to comment https://forums.phpfreaks.com/topic/210796-help-with-updating-db/ Share on other sites More sharing options...
RussellReal Posted August 15, 2010 Share Posted August 15, 2010 is it seperated by a certain char? try this (seperated by commas) $query_href = "update movies set href_parts = CONCAT(href_parts,',','{$updated_part}')"; Link to comment https://forums.phpfreaks.com/topic/210796-help-with-updating-db/#findComment-1099646 Share on other sites More sharing options...
daxguy Posted August 15, 2010 Author Share Posted August 15, 2010 thnx Link to comment https://forums.phpfreaks.com/topic/210796-help-with-updating-db/#findComment-1099647 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.