I'm trying to make a very, very simple query of a small mysql database, using the following code (with appropriate values in $host, etc.):
$result = mysqli_query($connection, "select university from universities_alpha");
$row = mysqli_fetch_array($result);
echo print_r($result);
echo '<br><br>';
echo print_r($row);
As you can see, I printed out the results in a human-readable way, yielding:
mysqli_result Object ( [current_field] => 0 [field_count] => 1 [lengths] => Array ( [0] => 19 ) [num_rows] => 9 [type] => 0 ) 1
Array ( [0] => Arizona State Univ. [university] => Arizona State Univ. ) 1
There are a few example universities in that column, so I'm not sure what I'm doing wrong.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…