Jump to content

Archived

This topic is now archived and is closed to further replies.

mATOK

please Help

Recommended Posts

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]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.