Two days and still cant suss it out

Hi all. This is just what I’ve been looking for to help me sort out a buggy bit of php code…I’m trying to be Microsoft free and I’m getting there!
Probably doing this all wrong but here’s the code…

[email protected]:/opt/lampp/htdocs/LIKEIT$ cat insert.php
// DB Info

<? PHP
$servername="localhost";
$username="root";
$password="";
$dbname="LIKEIT";
echo "$servername, $username, $dbname";
// Tell HTML details about DB;
// $conn = new mysqli ($servername, $username, $password, $dbname);
$_POST [ "first" ];
$_POST [ "surname" ];
$_POST [ "id" ];
$_POST [ "pcode" ];

// "Create and check DB Connection";
echo "BIT OF TEXT FROM PHP SCRIPT";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {

	die ("connection failed:" . $conn->connect_error);
else
	echo "Success"

}


echo $conn;

// SQL String

	$sql INSERT INTO customer_details ($first, $surname, $id, $pcode);
	VALUES  ('$first', '$surname', '$id', '$pcode');


// Close DB Connection

	$conn->close();
?>

Please edit your post and add either bbcode [code]...[/code] tags or markdown so that the code will be formatted and readable.

This doesn’t look like something is very wrong to you?

Sponsor our Newsletter | Privacy Policy | Terms of Service