skahan
5/29/2014 - 3:05 PM

Basic PHP MySQLi Prepared Statement

Basic PHP MySQLi Prepared Statement

Test text eplanation of prepared statement.
<?php
 
$query="SELECT petName, petAge, petSpecies
FROM pets
WHERE petAge < 10";
 
$stmt = $mysqli->prepare($query);
$stmt->bind_result($name,$age,$species);
$stmt->execute();
while($stmt->fetch()) 		{
 echo $name.' '.$age.' '.$species;
 echo '<br>';
}
 
?>