Updating mysql php

Rated 4.16/5 based on 769 customer reviews

$db_selected) $result = mysql_query("select id, username from users"); if (!

$result) while ($row = mysql_fetch_assoc($result)) $link = mysqli_connect("localhost", "my_user", "my_password", "my_db"); // database name can be specified from the beginning if (!

Different columns can have different combinations of automatic properties.$link) $result = mysqli_query($mysqli, "select id, username from users"); // uses the $mysqli object, obtained from mysqli_connect if (!$result) while ($row = mysqli_fetch_assoc($result)) Persistent connections In the old mysql extension, persistent connections are activated by using mysql_pconnect instead of mysql_connection.Historically the mysql extension was the only way until PHP 5.0 (circa 2004).After that mysqli appeared, which is an improved version of the older mysql driver.

Leave a Reply