Jump to content

please Help


mATOK

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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.