Hey, I need to make a query to pull the fields id and game from table A and insert them as media_id and game_id in table B, but only if the field game is not empty. I also need to insert 'news' into the field media_type in table B. How can I achieve this? Thanks, Connor Beaton
try this: $query_non_empty = "select id, game from table_one where game <> ''"; $result_non_empty = mysql_query($query_non_empty) or die(mysql_error()); while($non_empty_rows = mysql_fetch_array($result_non_empty)){ $xfer = "insert into table_two (media_id ,game_id) values ('".$non_empty_rows['id']."','".$non_empty_rows['game']."');"; $xfer_result = mysql_query($xfer) or die(mysql_error()); } PHP: