นี่คือโค้ดที่เขียนคะ
<?php
mysqli_connect("localhost","root","1234");
mysqli_select_db("choosingp");
$strSQL = "SELECT * FROM `s` WHERE ID ORDER BY `s`.`ID` ASC ";
?>
<!DOCTYPE html>
<html>
<head>
<title>ตัวอย่างเล่นๆ</title>
</head>
<body>
<table width="500" align="center" border="0">
<tr>
<td align ='center'>xxxx</td>
<td align ='center'>xxx</td>
</tr>
<?php
$resulf = mysqli_query($strSQL);
while ($re=mysqli_fetch_array($resulf))
{
?>
<tr>
<td><?php echo $rs['ID'];?></td>
<td><?php echo $rs['Name'];?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
ผลลัพธ์
Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\a.php on line 4
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\a.php on line 19
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\a.php on line 20
(พอดียังไม่ยืนยันตัวตนเลย โพสรูปที่แคปไม่ได้คะ)
php error ช่วยด้วยคะ
<?php
mysqli_connect("localhost","root","1234");
mysqli_select_db("choosingp");
$strSQL = "SELECT * FROM `s` WHERE ID ORDER BY `s`.`ID` ASC ";
?>
<!DOCTYPE html>
<html>
<head>
<title>ตัวอย่างเล่นๆ</title>
</head>
<body>
<table width="500" align="center" border="0">
<tr>
<td align ='center'>xxxx</td>
<td align ='center'>xxx</td>
</tr>
<?php
$resulf = mysqli_query($strSQL);
while ($re=mysqli_fetch_array($resulf))
{
?>
<tr>
<td><?php echo $rs['ID'];?></td>
<td><?php echo $rs['Name'];?></td>
</tr>
<?php
}
?>
</table>
</body>
</html>
ผลลัพธ์
Warning: mysqli_select_db() expects exactly 2 parameters, 1 given in C:\xampp\htdocs\a.php on line 4
Warning: mysqli_query() expects at least 2 parameters, 1 given in C:\xampp\htdocs\a.php on line 19
Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\a.php on line 20
(พอดียังไม่ยืนยันตัวตนเลย โพสรูปที่แคปไม่ได้คะ)