Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $servername = "";
- $username = "";
- $password = "";
- $dbname = "";
- $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
- $query = $conn->prepare("INSERT INTO foo (user_id,aaa,bbb,ccc,ddd,eee,fff) VALUES (:user_id, :aaa, :bbb, :ccc, :ddd, :eee, :fff)");
- $query->bindParam(':user_id', $user_id);
- $query->bindParam(':aaa', $aaa);
- $query->bindParam(':bbb', $bbb);
- $query->bindParam(':ccc', $ccc);
- $query->bindParam(':ddd', $ddd);
- $query->bindParam(':eee', $eee);
- $query->bindParam(':fff', $fff);
- $user_id = 2;
- $aaa = $_POST["aaa"];
- $bbb = $_POST["bbb"];
- $ccc = $_POST["ccc"];
- $ddd = $_POST["ddd"];
- $eee = $_POST["eee"];
- $fff = 1;
- $query->execute();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement