Re: Mysqli vs mysql
Your code
/* Display results */
echo "<table border='1'><thead><tr>";
for($i = 0;$i < mysql_num_fields($result);$i++)
{
echo "<th>".mysql_field_name ($result,$i) .
"</th>";
}
You have 2 mysql() functions there instead of mysqli. As you made the connection with mysqli() you have to use mysqli() functions on that connection.
Look up the php refman for mysqli() syntax
http://php.net/manual/en/refs.database.vendors.php
As PB says, any reference that shows to use mysql() should be archived. You should use a reference for mysqli() (or PDO).
Good luck,
Barry.
Subject
Written By
Posted
Re: Mysqli vs mysql
November 01, 2017 02:54PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.