Rookie questions. PHP reads MySQL.
Entry level rookie question:
Connection database Not responding
echo "Test MySQL";
@ $db =mysqli_connect (' 211.71.150.75 ', ' root ', ' 123 ', ' MySQL ');
echo "Test MYSQL1";
if (Mysqli_connect_errno ())
{
echo ' connection Error! ';
Exit
}
$query = "SELECT * from user";
$result = $db->query ($query);
$num _results= $result->num_rows;
echo ' results altogether '. $num _results ';
for ($i =0; $i < $num _results; $i + +)
{
$row = $result->fetch_assoc ();
Echo '
'. ($i + 1). '. Title: ';
}
?>
echo "Test test! ";
?>
Only output test MySQL, no other response.
Test MySQL under the command line, no problem.
Please advise, thank you first.
------Solution--------------------
It seems to be very irregular, some places do not read--#
If the database name is MySQL, there is a table user under it, which has the field name. You can write this:
PHP CodeTest MySQL
Results altogether $num"; while ($row = Mysql_fetch_assoc ()) { echo "
$row [Name]
"; }? >
-