Oracle 5.0 Reference Manual page 2487

Table of Contents

Advertisement

Return Values
Returns
on success or
TRUE
Examples
Example 20.173. Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$city = "Amersfoort";
/* create a prepared statement */
$stmt =
$mysqli->stmt_init();
if ($stmt->prepare("SELECT District FROM City WHERE Name=?")) {
/* bind parameters for markers */
$stmt->bind_param("s", $city);
/* execute query */
$stmt->execute();
/* bind result variables */
MySQL Improved Extension (Mysqli)
You can include one or more parameter markers in the SQL
statement by embedding question mark (?) characters at the
appropriate positions.
on failure.
FALSE
2467
Note
You should not add a terminating semicolon
or
to the statement.
\g
Note
The markers are legal only in certain places
in SQL statements. For example, they are
allowed in the VALUES() list of an INSERT
statement (to specify column values for a
row), or in a comparison with a column in
a WHERE clause to specify a comparison
value.
However, they are not allowed for identifiers
(such as table or column names), in the
select list that names the columns to
be returned by a SELECT statement),
or to specify both operands of a binary
operator such as the
=
restriction is necessary because it would be
impossible to determine the parameter type.
In general, parameters are legal only in Data
Manipulation Language (DML) statements,
and not in Data Definition Language (DDL)
statements.
equal sign. The latter

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mysql 5.0

Table of Contents