Answer the question
In order to leave comments, you need to log in
How to output specific mysql field via php?
I could not find anywhere exactly how the sql query is displayed in php, I tried like this:
$host='localhost';
$database='hidden';
$user='hidden';
$pswd='hidden';
$dbh = mysql_connect($host, $user, $pswd) or die("Не могу соединиться с MySQL.");
mysql_select_db($database) or die("Не могу подключиться к базе.");
$query = "SELECT * FROM `MusList` WHERE id = '1'";
$res = mysql_query($query);
while($row = mysql_fetch_array($res))
{
echo "Название: ".$row['name']."<br>\n";
echo "Ссылка: ".$row['link']."<br>\n";
echo "Дата: ".$row['date']."<br><hr>\n";
}
Answer the question
In order to leave comments, you need to log in
Is the table empty?
Try to get something out of it:
$host='localhost';
$database='hidden';
$user='hidden';
$pswd='hidden';
$dbh = mysql_connect($host, $user, $pswd) or die("Не могу соединиться с MySQL.");
mysql_select_db($database) or die("Не могу подключиться к базе.");
$query = "SELECT * FROM `MusList`";
$res = mysql_query($query);
while($row = mysql_fetch_array($res))
{
var_dump($row);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question