This array does seem to work with this stored procudure.... <?PHP include 'opendb.php'; ?> <?PHP include 'header.php'; ?> <?php $title = $_GET['title']; $firstname = $_GET['firstname']; $surname = $_GET['surname']; $ChildAdult = $_GET['ChildAdult']; $cost = $_GET['cost']; $notes = $_GET['notes']; $FlightID = $_GET['FlightID']; $ClientDetailID = $_GET['ClientDetailID']; //----Query 5------ $query = mssql_init ("sp_insertFlightSpaces"); $data = array( mssql_bind($query, "@FlightID", $FlightID, SQLVARCHAR)); mssql_bind($query, "@ClientDetailID", $ClientDetailID, SQLINT2}; 'ChildAdult' => array mssql_bind($query, "@ChildOrAdult", $ChildAdult, SQLVARCHAR); 'cost' => array mssql_bind($query, "@cost", $cost, SQLVARCHAR); 'notes' => array mssql_bind($query, "@notes", $notes, SQLVARCHAR); 'title' => array mssql_bind($query, "@Title", $title, SQLVARCHAR); 'firstname' => array mssql_bind($query, "@FirstName", $firstname, SQLVARCHAR); 'surname' => array mssql_bind($query, "@Surname", $surname, SQLVARCHAR); }; if (($result = mssql_execute($query)) === false) { die('Could not execute the query query 2(Insert client)'); } ///-------------------------------------------- } mssql_close() ?> <?PHP include 'footer.php'; ?> PHP: Then i'm getting errors such as this:
Which line and file? Please copy the whole error next time. By the way, the way your array is constructed is whacked! It should be like so (or so I think ): <?php include 'opendb.php'; ?> <?php include 'header.php'; ?> <?php $title = $_GET['title']; $firstname = $_GET['firstname']; $surname = $_GET['surname']; $ChildAdult = $_GET['ChildAdult']; $cost = $_GET['cost']; $notes = $_GET['notes']; $FlightID = $_GET['FlightID']; $ClientDetailID = $_GET['ClientDetailID']; //----Query 5------ $query = mssql_init("sp_insertFlightSpaces"); mssql_bind($query, "@FlightID", $FlightID, SQLVARCHAR); mssql_bind($query, "@ClientDetailID", $ClientDetailID, SQLINT2); mssql_bind($query, "@ChildOrAdult", $ChildAdult, SQLVARCHAR); mssql_bind($query, "@cost", $cost, SQLVARCHAR); mssql_bind($query, "@notes", $notes, SQLVARCHAR); mssql_bind($query, "@Title", $title, SQLVARCHAR); mssql_bind($query, "@FirstName", $firstname, SQLVARCHAR); mssql_bind($query, "@Surname", $surname, SQLVARCHAR); if (($result = mssql_execute($query)) === false) { die('Could not execute the query query 2(Insert client)'); } mssql_close() ?> <?php include 'footer.php'; ?> PHP:
Yeah thats the bit i'm trouble with.... but i think you posted the wrong code, its the same as the one above without the array........
What was the point of the array? I removed it because there seemed to be no need for it. Or is this what you wanted? (I'm confused ) $data = array( mssql_bind($query, "@FlightID", $FlightID, SQLVARCHAR), mssql_bind($query, "@ClientDetailID", $ClientDetailID, SQLINT2), 'ChildAdult' => mssql_bind($query, "@ChildOrAdult", $ChildAdult, SQLVARCHAR), 'cost' => mssql_bind($query, "@cost", $cost, SQLVARCHAR), 'notes' => mssql_bind($query, "@notes", $notes, SQLVARCHAR), 'title' => mssql_bind($query, "@Title", $title, SQLVARCHAR), 'firstname' => mssql_bind($query, "@FirstName", $firstname, SQLVARCHAR), 'surname' => mssql_bind($query, "@Surname", $surname, SQLVARCHAR), ); Code (markup):
Sorry i didnt get it yesterday, thats what happens when you look at code for the five hourse straight, do you think a for each would be better