From 51f301bb24839b24584a9ba1553c52a56259515e Mon Sep 17 00:00:00 2001 From: Georg Richter Date: Wed, 11 Feb 2004 08:10:47 +0000 Subject: [PATCH] changed description for mysqli_bind_param removed constants git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@151074 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqli/constants.xml | 28 ---------- .../mysqli/functions/mysqli-bind-param.xml | 51 ++++++++++++++----- 2 files changed, 39 insertions(+), 40 deletions(-) diff --git a/reference/mysqli/constants.xml b/reference/mysqli/constants.xml index d67a378c93..5e87c3886a 100644 --- a/reference/mysqli/constants.xml +++ b/reference/mysqli/constants.xml @@ -423,34 +423,6 @@ Field is defined as GEOMETRY - - - MYSQLI_BIND_STRING - (integer) - - Bind variable has type STRING - - - - MYSQLI_BIND_INT - (integer) - - Bind variable has type INT - - - - MYSQLI_BIND_DOUBLE - (integer) - - Bind variable has type DOUBLE - - - - MYSQLI_BIND_SEND_DATA - (integer) - - Sending bind variable in chunks - MYSQLI_NEED_DATA diff --git a/reference/mysqli/functions/mysqli-bind-param.xml b/reference/mysqli/functions/mysqli-bind-param.xml index 5b829e6b3e..b51a943b9c 100644 --- a/reference/mysqli/functions/mysqli-bind-param.xml +++ b/reference/mysqli/functions/mysqli-bind-param.xml @@ -1,5 +1,5 @@ - + mysqli_bind_param @@ -12,7 +12,7 @@ boolmysqli_bind_param objectstmt - arraytypes + stringtypes mixedvar1 mixedvar2, ... @@ -31,19 +31,48 @@ mysql_bind_param is used to bind variables for the parameter markers in the SQL statement that was passed to mysql_prepare. - The array types specifies the types for the - diffrent bind variables. Valid array values are MYSQLI_BIND_INT, MYSQLI_BIND_DOUBLE, - MYSQLI_BIND_STRING and MYSQLI_SEND_DATA. + The string types contains one or more characters which specify + the types for the corresponding bind variables + + Type specification chars + + + + Character + Description + + + + + i + corresponding variable has type integer + + + d + corresponding variable has type double + + + s + corresponding variable has type string + + + b + corresponding variable is a blob and will be send in packages + + + +
If data size of a variable exceeds max. allowed package size - (max_allowed_package), you have to specify MYSQLI_SEND_DATA and use + (max_allowed_package), you have to specify b in + types and use mysqli_send_long_data to send the data in packages. - The number of variables and array values must match the number of - parameters in the statement. + The number of variables and length of + string types must match the parameters in the statement. @@ -70,8 +99,7 @@ /* prepare statement and bind variables for insert statements */ $stmt = mysqli_prepare($link, "INSERT INTO mytable VALUES (?, ?, ?)"); - mysqli_bind_param($stmt, array(MYSQLI_BIND_INT, MYSQLI_BIND_INT, - MYSQLI_BIND_STRING), $a, $b, $c); + mysqli_bind_param("iis", $a, $b, $c); $a = 1; $b = 2; @@ -92,8 +120,7 @@ /* prepare statement and bind parameters */ $stmt = $mysql->prepare("INSERT INTO mytable VALUES (?, ?, ?)"); - $stmt->bind_param(array(MYSQLI_BIND_INT, MYSQLI_BIND_INT, - MYSQLI_BIND_STRING), $a, $b, $c); + $stmt->bind_param("iis", $a, $b, $c); $a = 1; $b = 2;