note 117385 added to mysqli.query

From: Date: Mon, 01 Jun 2015 20:30:56 +0000
Subject: note 117385 added to mysqli.query
Groups: php.notes 
Request: Send a blank email to php-notes+get-202718@lists.php.net to get a copy of this message
<?php //this will insert a user posted message into the database table messages //retrieved from html-page $name = $_POST["name"]; $email=$_POST["email"]; $title=$_POST["title"]; $message=$_POST["message"]; $mysqli = new mysqli("localhost", "login", "pass", "dbname"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } //echo $mysqli->host_info . "\n"; $con=mysqli_connect("localhost", "dbname", "db-pass", "dbname"); mysqli_query($con,"INSERT INTO messages(name,email,title,message) VALUES ('".$name."','".$email."','".$title."','".$message."')"); $result = mysqli_query($con, $query); if ( false===$result ) { printf("error: %s\n", mysqli_error($con)); } else { echo 'done.'; } ?> ---- Server IP: 72.52.91.14 Probable Submitter: 193.190.238.2 ---- Manual Page -- http://php.net/manual/en/mysqli.query.php Edit -- https://master.php.net/note/edit/117385 Del: integrated -- https://master.php.net/note/delete/117385/integrated Del: useless -- https://master.php.net/note/delete/117385/useless Del: bad code -- https://master.php.net/note/delete/117385/bad+code Del: spam -- https://master.php.net/note/delete/117385/spam Del: non-english -- https://master.php.net/note/delete/117385/non-english Del: in docs -- https://master.php.net/note/delete/117385/in+docs Del: other reasons-- https://master.php.net/note/delete/117385 Reject -- https://master.php.net/note/reject/117385 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#202718) next »