[RESOLVED] Does a prepared statement get cached?
Hey everyone, quick question. Says the PHP manual,
$stmt = $mysqli->prepare("SELECT * FROM test WHERE id = ?");
this will make the database prepare itself to run this query; find out the best way to run it, how to structure the results, etc. If I use this same $stmt later, then all that work is still saved, yay!
My question, however, is what if I don't use the $stmt variable? If I call $mysql->prepare with the same exact string, will it see that its the same as before, and use the earlier preparations? Or do I absolutely have to save the $stmt variable and use it again, to get the nice speed boost?