nixy Posted August 14, 2006 Share Posted August 14, 2006 Alright a little background - I'm pretty new to PHP but I know how to follow the lines and can understand it relatively well. My problem is writing it. What I am trying to create is an automated bank (i.e it uses variables put into the form to select which table into which the transaction will be added and another variable to select which table from which the transaction will be subtracted. Anyways, first off I'd like to know if I'm going in the right direction (I'm pretty sure I am, but if I'm not it explains a ton XD)and second off I'd like a little help with the code.I picked up a code from Jpmaster77 on registering and logging in and it's a bit complicated for me and I can follow it vaguely enough though. I'd like for a table with the chosen username to be created when the person registers, however I keep getting the error Parse error: parse error, unexpected T_VARIABLE in /home/paleysa/public_html/vscb/Blah/database.php on line 159 coming up ::) and I don't know what to do. I've linked my files as text files so that the code can be viewed. Everything except the function addNewTable in database.txt was written by Jpmaster77. I'd want to enter $database->addNewTable($subuser) on to line 321 (session.php) after if($database->addNewUser($subuser, md5($subpass), $subemail)) but once again I don't know how to do that either.[url=http://pale-sake.com/vscb/Blah/session.txt]http://pale-sake.com/vscb/Blah/session.txt[/url][url=http://pale-sake.com/vscb/Blah/process.txt]http://pale-sake.com/vscb/Blah/process.txt[/url][url=http://pale-sake.com/vscb/Blah/constants.txt]http://pale-sake.com/vscb/Blah/constants.txt[/url][url=http://pale-sake.com/vscb/Blah/database.txt]http://pale-sake.com/vscb/Blah/database.txt[/url]If I come off as too new to help and it's a really simple answer and no one feels like wasting their time helping me with something so simple - then maybe a nice link to point me in the right direction?Thanks!Nixy Quote Link to comment https://forums.phpfreaks.com/topic/17560-having-a-little-trouble/ Share on other sites More sharing options...
sasa Posted August 14, 2006 Share Posted August 14, 2006 function addNewTable($username){ $q = "CREATE TABLE IF NOT EXISTS ".$username."('to' varchar(30) not null, 'from' varchar(30) not null, 'amount' int not null, 'date' date not null primary key, 'for' varchar(250))"; return mysql_query($q, $this->connection); } Quote Link to comment https://forums.phpfreaks.com/topic/17560-having-a-little-trouble/#findComment-74789 Share on other sites More sharing options...
nixy Posted August 14, 2006 Author Share Posted August 14, 2006 ^_^ oh wow that was simple - thanks sasa! Quote Link to comment https://forums.phpfreaks.com/topic/17560-having-a-little-trouble/#findComment-74807 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.