Jump to content


This topic is now archived and is closed to further replies.


Having a little trouble

Recommended Posts

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.

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?


Share this post

Link to post
Share on other sites
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);

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.