代號姓名
性別民族
生日<?php
//造乙個mysqli物件,造連線物件
$db = new mysqli("localhost","root","123","mydb");
//準備一條sql語句
$sql = "select * from info";
//執行sql語句,如果是查詢語句,成功返回結果集物件
$reslut = $db->query($sql);
//判斷返回是否執行成功
if($reslut)
"; }
}?>
<?php
//造連線物件
$db = new mysqli("localhost","root","123","mydb");
//準備sql語句
$sql = "delete from info where code='p004'";
//執行sql語句
$r = $db->query($sql);
if($r)
else
?>
<?php
$db = new mysqli("localhost","root","123","mydb");
$sql = "select * from nation";
$result = $db->query($sql);
echo "";
if($result)
"; } }
echo "";
?>
PHP與MySql資料庫連線
繁寫 echo this is a test echo asdfasdfadsf mysql server name localhost 資料庫伺服器名稱 mysql username root 連線資料庫使用者名稱 mysql password 連線資料庫密碼 mysql database 資料庫...
mysql與php的連線 PHP 連線mysql
php 連線mysql mysqlhost localhost mysqluser root mysqlpass mysqldata mydata connect mysql connect mysqlhost,mysqluser,mysqlpass or die 錯誤 mysql error my...
php與MySQL的連線
繁寫 echo this is a test echo asdfasdfadsf mysql server name localhost 資料庫伺服器名稱 mysql username root 連線資料庫使用者名稱 mysql password 連線資料庫密碼 mysql database 資料庫...