Hello im not all that new in php scripting, bu i just started php + mysql so please bare with me.
I have the basic script:
<?php
$con = mysql_connect("localhost","user","password");
if(!$con)
{
die('Could not connect: '.mysql_error());
}
else
{
echo "You have connected to database";
}
//create table for peeps
mysql_select_db("database name", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int,
UserName varchar(15),
Password(15),
)";
mysql_query($sql,$con);
mysql_close($con);
?>
however i always get the error message
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?PHP
$con = mysql_connect("localhost","user"' at line 1
im not quite sure what i am doing wrong, ofcourse the username, password, database name ans host has been replaced in here, i have confirmed that i am able to connect. its getting me pretty upset because i know that its a simple script and i cant get it to work.:mad: please assist!