Hi all,
One more quick question about my code from the previous thread I posted. Once my T_Variable problem was solved (), I noticed that the page said my query was empty (
). I did not find my submitted parts of the form I created in my PHPMyAdmin database (:eek
. Did I connect incorrectly to the database? Here's my code once more:
<html>
<head>
<title> Lego Comic </title>
</head>
<body> <center>
<h1> Thank you for joining! Now click <a href="index.php" title="Login"> HERE </a> to login! </h1>
<?php
//Connect to the database server
mysql_connect("mysql2.**********.com","xxxxxxxx_xxxxx","xxxxxxxx") or die (mysql_error ());
//Select database
mysql_select_db("xxxxxxxx_xxxxx") or die (mysql_error ());
//The SQL statement is built by the user, taking information from becomeamember.php
$strSQl = "INSERT INTO Members(firstname) values('" . $_POST["firstname"] . "')";
//The SQL statement is executed
mysql_query($strSQL) or die (mysql_error());
$strSQL = "INSERT INTO Members(username) values('" . $_POST["username"] . "')";
//The SQL statement is executed
mysql_query($strSQL) or die (mysql_error());
$strSQL = "INSERT INTO Members(password) values('" . $_POST["password"] . "')";
//The SQL statement is executed
mysql_query($strSQL) or die (mysql_error());
//Close the database connection
mysql_close();
?>
</center> </body>
</html>
Thanks in advance.