NoobLaPHP Posted March 17, 2014 Share Posted March 17, 2014 I have a select option and want to include it in my query. $select = mysql_real_escape_string($_POST[select]); if($fetch->where$select){ So if the select value was at 2 it would read if($fetch->where2){ How would i do it? Would if($fetch->where.$select){ work putting in a . ? also in the mysql mysql_query("UPDATE `table` SET `where$select`='input' "); Link to comment https://forums.phpfreaks.com/topic/287029-query-inside-a-query/ Share on other sites More sharing options...
NoobLaPHP Posted March 17, 2014 Author Share Posted March 17, 2014 Figured it out. I used $where = "where".$select; if($fetch->$where){ mysql_query("UPDATE `table` SET `$where`='input' "); Link to comment https://forums.phpfreaks.com/topic/287029-query-inside-a-query/#findComment-1472879 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.