saalek110
Well-Known Member
کد نمایش کامنت ها این طوری میشه حالا:
در کد بالا ، با شرط approve برابر با free بودن ، بقیه ستون ها چاپ می شوند.
در کوئری ، یک متغیر $post_number داریم ، این متغیر با GET از فایل index.php گرفته شده:
دیگه چیزی نداره توضیح بدهم ، یک کوئری است و چاپ ستون ها.
PHP:
$sql = "SELECT * FROM nazarat WHERE post_number=$post_number";
$result = mysqli_query($ccoonn ,$sql);
echo"<center>";
echo"<table border=1>";
while($info = mysqli_fetch_array( $result ))
{
echo"<tr>";
$number=$info['number'];
$approve=$info['approve'];
$poster=$info['poster'];
$time=$info['time'];
$nazar=$info['nazar'];
if ($approve=="free")
{
echo"<tr><td >"; echo $number; echo"</td>";
echo"<td >"; echo $poster; echo"</td>";
echo"<td >";
echo $time;
echo"</td>";
echo"<td id='t4'>";
echo"</td><tr>";
echo"<tr><td colspan='4' >";
echo nl2br($nazar);
echo"</td></tr>";
echo"<tr><td colspan='4' >";
echo"</td></tr>";
echo"</tr>";
}// if approve==free
} //while
echo"</table>";
echo"</center>";
در کوئری ، یک متغیر $post_number داریم ، این متغیر با GET از فایل index.php گرفته شده:
PHP:
$post_number=$_GET['number'];




















