因為要使用mysqli的連線方式,舊的mysql連線怕以後不太適用了,所以改成ADONewConnection用mysqli連線。
語法:
include 'adodb.inc.php';
//Simple connection
$driver = 'mysqli';
$db = adoNewConnection($driver);
// Now connect to the database
$db->connect('localhost','user','password','employees');
//取得資料
$recordSet = $db->Execute($sqlstr);
//警示連線錯誤
if ($recordSet === false) die( $sqlstr."<br> connect_failed");
$row = $recordSet->FetchRow();