insert ไม่เข้าฐานข้อมูล รบกวนช่วยด้วยครับ

สำหรับผู้ที่ เริ่มต้น Programming - PHP มีอะไร แนะนำ หรือข้อสงสัยต้องบอร์ด นี้ คนที่มีความรู้ แบ่งปันคนอื่นบ้างนะ ปัญหาการเขียนโปรแกรม แบบ OOP Session Cookies php network

Moderator: mindphp, ผู้ดูแลกระดาน

notenote

insert ไม่เข้าฐานข้อมูล รบกวนช่วยด้วยครับ

โพสต์ที่ยังไม่ได้อ่าน โดย notenote »

<?php

include "connect.php";
$tfbnum = $_POST['txt1'];
$tfbname = $_POST ['txt2'];
$tfbaddress = $_POST ['txt3'];
$tfbtel = $_POST ['txt4'];
$link = mysqli_connect("localhost", "root","","dbtfb");

$sql="INSERT INTO `tfbdb`(`tfbnum`, `tfbname`, `tfbaddress`, `tfbtel`) VALUES ([$tfbnum],[$tfbname],[$tfbaddress],[$tfbtel])";

echo $sql;

$result=mysqli_query($link,$sql);

if ($result){
echo "save success";
echo "[<A href=tfbaddbranch2.html>Click Back</a>]";

}else{
echo "don't successsssssss";
}


?>
หลังจากที่ ลอง Echo $sql ออกมาแล้วได้ แบบนี้ครับ
INSERT INTO `tfbdb`(`tfbnum`, `tfbname`, `tfbaddress`, `tfbtel`) VALUES ([2],[2],[2],[2])don't successsssssss
รบกวนช่วยดูให้ด้วยครับ ผมผิดพลาดตรงไหน ขอบคุณล่วงหน้าครับ
  • Similar Topics
    ตอบกลับ
    แสดง
    โพสต์ล่าสุด

ผู้ใช้งานขณะนี้

สมาชิกกำลังดูบอร์ดนี้: Google Adsense [Bot] และบุคลทั่วไป 109