Mysql_fetch_row
function Db_connect ()
{
$result = new mysqli (' localhost ', ' root ', ' 654321 ', ' smsprj ');
$result = new mysqli (' localhost ', ' root ', ' 654321 ');
if (! $result)
{
throw new Exception (' Could not connect to database server ');
}
Else
{
return $result;
}
}
?>
$conn = Db_connect ();
$sql = $conn->query ("SELECT * from user");
if (! $sql)
{
Echo ("wrong");
}
Else
{
echo "
Reply to discussion (solution)
That's what happens in Db_connect.
$result = new mysqli (' localhost ', ' root ', ' 654321 ', ' smsprj ');
So to query this
$sql = $conn->query ("SELECT * from user");
To read this way
while ($row = $sql->fetch_row ())
Thank you very much, go to the company tomorrow to try.
have been arranged to do not work at all, it really makes people egg pain AH
Thank you very much, go to the company tomorrow to try.
have been arranged to do not work at all, it really makes people egg pain AH
Thank you very much, go to the company tomorrow to try.
have been arranged to do not work at all, it really makes people egg pain AH
"; echo "
Userid |
Name |
Pssword |
Maxsmscount |
Maxuseday |
Leftday |
Leftsmscount |
"; while ($row = Mysql_fetch_row ($sql)) {echo "
$row [0] |
$row [1] |
$row [2] |
$row [3] |
$row [4] |
$row [5] |
$row [6] |
"; }} My goal is to display all the user information in the database, but this program always error, do not know what the reason for the help of the hero, the younger brother greatly appreciated