manhattes Posted October 7, 2015 Share Posted October 7, 2015 I would like to save my output of a search into an existing table where two columns match. UPDATE table_nameSET column1=value1WHERE some_column=some_value AND some_column=some_value; Is this possible or do I have to use a join or something? Quote Link to comment Share on other sites More sharing options...
Solution QuickOldCar Posted October 7, 2015 Solution Share Posted October 7, 2015 It's fine to do as that, just run a second query for the update. Quote Link to comment Share on other sites More sharing options...
manhattes Posted October 7, 2015 Author Share Posted October 7, 2015 It's fine to do as that, just run a second query for the update. $queryP="UPDATE table_name SET column1=value1 WHERE some_column=some_value AND some_column=some_value;" $update = mysql_query($queryP) or die(mysql_error()); I dont understand. Quote Link to comment Share on other sites More sharing options...
QuickOldCar Posted October 7, 2015 Share Posted October 7, 2015 (edited) What part don't you understand? The query you have should be fine if use actual values. Post your current code if need more assistance with it. btw, mysql_* functions are deprecated and will be removed in php7, you should use mysqli_* functions or pdo Edited October 7, 2015 by QuickOldCar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.