Answer the question
In order to leave comments, you need to log in
PHP code error on nic.ru hosting. What to fix?
Hello!
I ask you right away - do not judge strictly, PHP has just begun to study.
There is a code that !works! to localhost (pulls record from database)
<?php
$host = 'myLogin.mysql';
$database = 'myLogin_test';
$user = 'myLogin_mysql';
$pswd = 'password';
$dbh = mysqli_connect ($host, $user, $pswd) or die ("No connect to server: " . mysql_error());
mysql_select_db ($database) or die ("No connect do db: " . mysql_error());
$query = "SELECT * FROM `my_sql_table`";
$res = mysql_query($query);
while($row = mysql_fetch_array($res))
{
echo "Номер: ".$row['id']."<br>\n";
echo "Имя: ".$row['firstname']."<br>\n";
echo "Фамилия: ".$row['surname']."<br><hr>\n";
}
?>
$host = 'myLogin.mysql';
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question