mATOK Posted October 4, 2006 Share Posted October 4, 2006 Will the below work?I grab all by form data and stick into an array, then I create a querry for each instance in the array. [code] $cname = $_GET['cname']; $numusrs = $_GET['numusrs']; $newclient="INSERT INTO Customer (Name, NumberOfAccounts, InsertUserID, InsertDate, FeesPaid ) VALUES('$cname', '$numusrs', '14', GETDATE (), '1' )"; mssql_query($newclient) or die (mssql_query()); $lastinput="SELECT TOP 1 * FROM Customer ORDER BY InsertDate"; mssql_query($lastinput) or die (mssql_query()); while ($found = mssql_fetch_array($lastinput)){ $lastid =$found['CustomerID']; } $i=0; while ($i < 27) { $array[$i] = $_GET[$i]; $i++; } $t=0; while ($t < 27) { $sqlarray[$t] = "INSERT INTO Customer_Market ( CustomerID, MarketID, ) VALUES ('$lastid', '$array[$t]')"; } foreach ($sqlarray[$t]) { $rs = mysql_query($sqlarray[$t]) or die("Problem with the query: $sqlarray[$t] <br />" . mysql_error()); }}[/code] Quote Link to comment Share on other sites More sharing options...
trq Posted October 4, 2006 Share Posted October 4, 2006 Try it? 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.