All pastes #587455 Raw Edit

malaiac

public php v1 · immutable
#587455 ·published 2007-06-24 16:25 UTC
rendered paste body
echo "<br /><br />MYSQL";mysql_connect($sql_host,$sql_user,$sql_pass) or die(mysql_error());mysql_select_db($sql_base);$result = mysql_query("SELECT * FROM texte");while($row = mysql_fetch_array($result)) { echo '<pre>'; print_r($row); echo '</pre>';}// OK !echo "<br /><br />MYSQLI";$sql = new mysqli($sql_host,$sql_user,$sql_pass,$sql_base) or die(mysqli_error($dblink));if(!$sql->ping()) echo "<br />PAS DE CONNEXION"; // => no problemo$query = $sql->query("SELECT * from texte") or $sql->errors[$sql->error]++; // => no errorwhile($row = $query->fetch_object) { echo '<pre>'; print_r($row); echo '</pre>';}// NOT OK ! (0 result)