Jump to content

Having a little trouble


nixy

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.
[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 
Link to comment
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);
  }
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.