Правя си аз едни коментари , но нещо не става ...
Kато изпратя коментар ми показва :arrow:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in view.php on line 5
Код:
<?php
$view = mysql_fetch_array(mysql_query("select * from alle where id=$view"));
if (empty ($view[id])) {
print "Nema takova jivotno ...";
exit;
}
if ($view[varified] == 'No') {
print "Linka ne e potvyrden ..";
exit;
}
print "Name: $view[name]<br>";
print "Opisanie: $view[descr]<br>";
print "Owner: $view[owner]<br>";
print "<b>Komentari</a></b>";
print" <form method=POST action=view.php?action=comment>
<p>Komentar : <input type=text name=text size=30>
<input type=submit value=изпрати name=send></p>
</form> ";
print "<table border=1 width=500>
<tr><td>Date add</td><td>Name</td><td>Message</td></tr>";
$comments = mysql_query("select * from comments where link_id='$view[id]' order by id asc");
while ($c = mysql_fetch_array($comments)) {
$user = mysql_fetch_array(mysql_query("select * from users where id='$c[user_id]' "));
print "<tr><td>$c[data]</td><td>$user[user] </td><td>$c[body]</td></tr>";
}
print "</table><BR><BR>";
if ($action == comment ) {
if (strlen($text) < 1 ) {
print"Heheh , nemoje komentara da e tolkova malyk ....";
exit;
}
$date1 = date("Y:m:d");
$date = date("H:i:s");
mysql_query("insert into comments (user_id, link_id, body, data ) values('$stat[id]', '$view[id]', '$text', ' $date , $date1' )") or die("Could not add reply.");
}
?>
Kато изпратя коментар ми показва :arrow:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in view.php on line 5