winterdude
07-30-2007, 01:41 AM
OK, so I go an "Unexpected T_String Error" and I want to know what I'm doing wrong. I'm still new at this type of thing and am unsure of how to fix it.
<?php
include 'members/include/session.php';
include 'members/connect.php';
mysql_select_db('winterdu_members') or die('Cannot select database');
$query = 'CREATE TABLE print $_SESSION['username']profile( '.
'name VARCHAR(50) NOT NULL, '.
'age VARCHAR(2) NOT NULL, '.
'citystate VARCHAR(50) NOT NULL, '.
'country VARCHAR(30) NOT NULL, '.
'about VARCHAR(5000) NOT NULL, '.
'music VARCHAR(5000) NOT NULL, '.
'movies VARCHAR(5000) NOT NULL, '.
'tv VARCHAR(5000) NOT NULL, '.
'hobbies VARCHAR(5000) NOT NULL, '.
'PRIMARY KEY(name))';
$result = mysql_query($query);
?>
It says the error is on line 7 which is:
$query = 'CREATE TABLE print $_SESSION['username']profile
I know that the print $_SESSION part is the problem, but I just don't know how to fix it so that it will work.
For a little background information, what that would do is create the table "usernameprofile" so if UserA was logged in, the table UserAprofile would be created.
<?php
include 'members/include/session.php';
include 'members/connect.php';
mysql_select_db('winterdu_members') or die('Cannot select database');
$query = 'CREATE TABLE print $_SESSION['username']profile( '.
'name VARCHAR(50) NOT NULL, '.
'age VARCHAR(2) NOT NULL, '.
'citystate VARCHAR(50) NOT NULL, '.
'country VARCHAR(30) NOT NULL, '.
'about VARCHAR(5000) NOT NULL, '.
'music VARCHAR(5000) NOT NULL, '.
'movies VARCHAR(5000) NOT NULL, '.
'tv VARCHAR(5000) NOT NULL, '.
'hobbies VARCHAR(5000) NOT NULL, '.
'PRIMARY KEY(name))';
$result = mysql_query($query);
?>
It says the error is on line 7 which is:
$query = 'CREATE TABLE print $_SESSION['username']profile
I know that the print $_SESSION part is the problem, but I just don't know how to fix it so that it will work.
For a little background information, what that would do is create the table "usernameprofile" so if UserA was logged in, the table UserAprofile would be created.