june_c21 Posted October 21, 2007 Share Posted October 21, 2007 hi, how to perform mysql query and assign value into php variable ? Table 1 -equipment -.... -..... Table 2 -equipment -.... -.... now i want to assign the equipment value from table 1 to equipment on table 2. how to write the code in php? or it is my code got error $equipment = $_get['equipment']; $query = "SELECT equipment FROM equipment WHERE equipment=$_GET['equipment']"; $query2 = "INSERT INTO report (equipment) values ($equipment)"; $result2 = mysql_query ($query2,$dblink); echo $query2; Link to comment https://forums.phpfreaks.com/topic/74176-mysql-query-and-assign-value-into-php-variable/ Share on other sites More sharing options...
Barand Posted October 21, 2007 Share Posted October 21, 2007 I've seen this same question in a couple of other topics, one of which I've replied to. Don't double post. Closing. Link to comment https://forums.phpfreaks.com/topic/74176-mysql-query-and-assign-value-into-php-variable/#findComment-374647 Share on other sites More sharing options...
Recommended Posts