Last active
February 3, 2017 14:32
-
-
Save n-osennij/88da638add2cb4b593e34298fc8c1ae1 to your computer and use it in GitHub Desktop.
query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//тут должно быть подключение в базе, которое сохраняем в $connection | |
$query = "SELECT * FROM cenybd"; | |
$result = $connection->query($query); | |
if (!$result) {die($connection->error);}; | |
//Перебор и вывод всех полученных результатов в цикле, пока они есть | |
while ($myrow = $result->fetch_array(MYSQLI_ASSOC)) { | |
$example=$myrow['exaple']; | |
echo $example.'<br>'; | |
}; | |
//а это без цикла - только первый результат | |
$myrow = $result->fetch_array(MYSQLI_ASSOC); | |
echo $myrow['exaple']; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment