Kokarn
09-15-2006, 10:34 AM
Im very new to PHP and MySQL, but im trying to do a simple database and login for users. The code i use is:
<?php
require_once('connect.php');
mysql_query('CREATE TABLE `users` (
`id` int(15) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`password` varchar(32) NOT NULL default '',
`date_registered` int(10) NOT NULL default '0',
`last_seen` int(10) NOT NULL default '0',
PRIMARY KEY (`id`)
)');
echo 'Table created';
?>
I get an error, shown below.
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/onyttse/public_html/thursday/create_table.php on line 6
I checked around a bit, and found out that in most cases, it's just a ";" missing, so i added that to all the lines, nothing, and also removed the "," from all the lines. Still nothing.
Also tried to change all the " ` " to " ' ", all i got by doing that is another error, shown below:
Parse error: parse error, unexpected T_STRING in /home/onyttse/public_html/thursday/create_table.php on line 3
Guess thats for chaning data types or something?
So, what's my problem?
Thanks in advance // Oskar Risberg
<?php
require_once('connect.php');
mysql_query('CREATE TABLE `users` (
`id` int(15) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`password` varchar(32) NOT NULL default '',
`date_registered` int(10) NOT NULL default '0',
`last_seen` int(10) NOT NULL default '0',
PRIMARY KEY (`id`)
)');
echo 'Table created';
?>
I get an error, shown below.
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/onyttse/public_html/thursday/create_table.php on line 6
I checked around a bit, and found out that in most cases, it's just a ";" missing, so i added that to all the lines, nothing, and also removed the "," from all the lines. Still nothing.
Also tried to change all the " ` " to " ' ", all i got by doing that is another error, shown below:
Parse error: parse error, unexpected T_STRING in /home/onyttse/public_html/thursday/create_table.php on line 3
Guess thats for chaning data types or something?
So, what's my problem?
Thanks in advance // Oskar Risberg