Jump to content


Photo

please Help


  • Please log in to reply
1 reply to this topic

#1 mATOK

mATOK
  • Members
  • PipPipPip
  • Advanced Member
  • 84 posts
  • LocationToronto, Ontario

Posted 04 October 2006 - 04:32 PM

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.

        $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());
        }
}

"Not everything that counts can be counted, and not everything that can be counted counts."

W3 Web Tutorials | Check Your html | CSS layout techniques | ALA | Zen Garden | CSS Links

Navs with flavor | CSS Playground | CSS boxes

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 04 October 2006 - 04:33 PM

Try it?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users