Jump to content

Recommended Posts

I got an array that is processing mutiple form elements... When it comes into the process it gets processed by using a stored procedure... But i think i dont have the array setup properly:

 

 

<?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);

$data = array('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'; ?>

 

I keep on getting errors such as:

 

Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\ line 34

 

Thanks for the help....

Link to comment
https://forums.phpfreaks.com/topic/63033-array-confusion/
Share on other sites

This line:

'surname' => array mssql_bind(($query, "@Surname", $surname, SQLVARCHAR));

Needs to be

'surname' => array (mssql_bind($query, "@Surname", $surname, SQLVARCHAR)));

 

You had your braces in the wrong placeand you forgot to add a closing ) brace for the parent array

Link to comment
https://forums.phpfreaks.com/topic/63033-array-confusion/#findComment-313923
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.