0
如何查看合適的代碼以便拿起和編輯文章?我試圖做到這一點,但仍然得到mysqli_fetch_assoc()預計參數1被mysqli_result,在字符串中給出。試圖獲取並編輯文章
<?php
$db = mysqli_connect("localhost", "root", "root", "maturita");
if(isset($_GET['edit_art']))
{
$sql="SELECT * FROM articles WHERE id_art='{$_GET['id_edit']}'";
$query=mysqli_query($db, $sql);
while($log = mysqli_fetch_assoc($sql)):
$subject = $log["subject"];
$text = $log["text"];
?>
<div class="content2">
<div class="content title1">
Edit Article
</div>
<div class="content backgrounded">
<form action="#" method="post">
<table>
<tr>
<td>Subject: </td><td><input class="subject form form3" type="text" name="subject"><?php $subject; ?></input></td>
</tr>
<td>Text: </td><td><textarea name="text" rows="5" cols="51"><?php echo $text; ?></textarea></td>
</tr>
<tr>
<td><input type="submit" class="button button5" name="submit" value="Submit"/></td>
</tr>
</table>
</form>
</div>
</div>
<?php endwhile;}?>