<?php $link = mysqli_connect("localhost","root","root","dbname"); //連接資料庫 $sql = "select field from dbname limit 1"; $ressql = mysqli_query($link,$sql ...
<?php
$link = mysqli_connect("localhost","root","root","dbname"); //連接資料庫
$sql = "select field from dbname limit 1";
$ressql = mysqli_query($link,$sql);//執行sql
$res = $ressql->fetch_object()->field;//得到結果