beanfair Posted August 24, 2005 Share Posted August 24, 2005 I am updating a table, inserting multiple rows from a previous form. This works and inserts the rows mysql_select_db($database_zen, $zen); $query_rsCC = "INSERT INTO tblPackingList (marketwk, crop, out) SELECT tblPackingListOLD.marketwk, tblCrop.crop, tblPackingListOLD.cc AS out FROM tblCrop INNER JOIN tblPackingListOLD ON tblCrop.cropID = tblPackingListOLD.crop WHERE tblPackingListOLD.marketwk=17 AND tblPackingListOLD.cc>0"; $rsCC = mysql_query($query_rsCC, $zen) or die(mysql_error()); However, I also need to insert values that are concatenation. The concat works and creates the value that I need. SELECT CONCAT("cc",tblPackingListOLD.marketwk, tblCrop.crop) AS pid FROM tblCrop INNER JOIN tblPackingListOLD ON tblCrop.cropID = tblPackingListOLD.crop Now I need help incorporating the concat into the insert query so that (pid, marketwk, crop, out) are inserted Thanks Quote Link to comment https://forums.phpfreaks.com/topic/2464-making-a-concat-in-an-insert/ 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.