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] Link to comment https://forums.phpfreaks.com/topic/22989-please-help/ Share on other sites More sharing options...
trq Posted October 4, 2006 Share Posted October 4, 2006 Try it? Link to comment https://forums.phpfreaks.com/topic/22989-please-help/#findComment-103771 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.