Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

pdo bindparam string

<?php
/* Execute a prepared statement by binding PHP variables */
$calories = 150;
$colour = 'red';
$sth = $dbh->prepare('SELECT name, colour, calories
    FROM fruit
    WHERE calories < :calories AND colour = :colour');
$sth->bindParam(':calories', $calories, PDO::PARAM_INT);
$sth->bindParam(':colour', $colour, PDO::PARAM_STR, 12);
$sth->execute();
?>
Source by www.php.net #
 
PREVIOUS NEXT
Tagged: #pdo #bindparam #string
ADD COMMENT
Topic
Name
1+7 =