Gunther: mysqli - Unterschied prepared Statement und direkte Query

Beitrag lesen

Hallo!

Im 1. Fall:

string(256) "Lorem ipsum dolor sit amet, con ..."

Im 2. Fall:

string(3023) "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod..."

Auch wenn du deine extra Klasse (StdClass) mal weglässt?
Also:

  
$mysqli    =    new Mysqli('localhost', 'root', '#+#', 'koch');  
$stmt      =    $mysqli->prepare('SELECT  ingredients FROM content WHERE id=?');  
$id        =    92;  
$stmt->bind_param("i", $id);  
$stmt->execute();  
$stmt->bind_result($ingredients);  
$stmt->fetch();  
var_dump($ingredients);  

Gruß Gunther