wamp2.5以及MYSQL 5.6.17版本的請參考以下代碼
$sqlencod="insert into test(name) values('蘋果')";
if(mysqli_query ($con,$sqlencod))
{
echo"插入成功";
}
else
{
echo"插入失敗";
}
$sqlencod="insert into test(name) values('蘋果')";
if(mysqli_query ($con,$sqlencod))
{
echo"插入成功";
}
else
{
echo"插入失敗";
}
2015-12-08
本擴展自 PHP 5.5.0 起已廢棄,并在將來會被移除。應使用 MySQLi 或 PDO_MySQL 擴展來替換之。
MySQLi
面向對象風格
mixed mysqli::query ( string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
過程化風格
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
MySQLi
面向對象風格
mixed mysqli::query ( string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
過程化風格
mixed mysqli_query ( mysqli $link , string $query [, int $resultmode = MYSQLI_STORE_RESULT ] )
2015-12-08