您好,登錄后才能下訂單哦!
<?= MySQLi("localhost","root","12345678","heiheihei" = "select * from student" = ->query(( = -> (?>
最后的返回值是一個集對象,為了方便清晰的看到結果 我們用到了fetch_all(),fetch_row(); fetch_object();
//造連接對象$db = new MySQLi("localhost","root","12345678","heiheihei");//準備SQL語句$sql = "insert into cou values('3-111','嘿嘿','803')"; //執行SQL語句$r = $db ->query($sql);if($r)//如果$r是ture{ echo "執行成功"; }else { echo "執行失敗"; }
<?php//造連接對象$db = new MySQLi("localhost","root","12345678","heiheihei");//準備SQL語句$sql = "update cou set cname='哈哈' where tno='803'"; //執行SQL語句$r = $db ->query($sql);if($r) { echo "執行成功"; }else { echo "執行失敗"; }?>
<?php//造連接對象$db = new MySQLi("localhost","root","12345678","heiheihei");//準備SQL語句$sql = "delete from cou where tno='803'"; //執行SQL語句$r = $db ->query($sql);if($r) { echo "執行成功"; }else { echo "執行失敗"; }?>
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。