Hi, all!
It's me again. And i'm idiot.
I have in my table many-many articles. Their titles and anonses showed on page article.php
<?php
mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
mysql_query("SET NAMES utf8");
$sql = "SELECT*FROM advicer ORDER BY id DESC LIMIT 4";
$result= mysql_query($sql) or die(mysql_error());
while ($row = mysql_fetch_array($result)){
$id = $row['id'];
echo '<a href="view.php?&id='.$id.'">' . '<h5>' . $row['title'] . '</h5>' . '</a>';
echo '<p>' . $row['anons'] . '</p>';
}
?>
It's work.
And user can to see one article if clicks on title
<?php
mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
mysql_query("SET NAMES utf8");
$sql = "SELECT*FROM advicer WHERE id='$id'";
$result= mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result){
echo '<h5>' . $row['title'] . '</h5>';
echo '<p>' . $row['text'] . '</p>';
}
?>
But it's not work. I see white page with url /view.php?&id=208
What is to be done? What is wrongly? Variable, syntaxis, method or my brain?