PHP MYSQL people!

TaO

Tree Surgeon
Joined
Dec 14, 2007
Messages
795
Location
The Hague
Okay, i need a beginner with PHP and mysql coding.

I'm a total noob and i'm stuck with this thing..

I got a registration form... when a user registers, he gets an unique ID within a user talbe in the sql.
i got a 2nd table which would allow the user to do an action within the forum *post messages based on credits*. Every user gets 5 free credits on sign-up.

So a simple sql would be
User - UID, username, password, email etc etc
Credits - UID, amount, level etc etc

This should be very easy, but for some reason i just can't find out what i'm doing wrong.

So far i got.. user can register and gets and UID.. and then i'm stuck ;-), i just can't find out how to get the UID from table 1 into table 2.

Any help is much appreciated!
 

alwaysnumb

Head Gardener
Joined
Jan 7, 2008
Messages
309
Location
London
select the UID you just made in user table then insert it into credits table
or
If the stuff in credits table is 1 unique entry for each user just make user table bigger.
or
create a large random UID in a variable if not exist in user table insert into user+credits if exists repeat
 

TaO

Tree Surgeon
Joined
Dec 14, 2007
Messages
795
Location
The Hague
I got the issue :)

was using old school PHP4 scripting instead of PHP5 :)
 
Last edited:
Top