• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

MySQL help needed!

Status
Not open for further replies.

RedDwarf

Smegging smeg of a smeg!
I'm trying to figure out how to do this:

Someone logs into a form using a personalized code that's entered into a MySQL field, they then fill out a form and submit their answers, which adds that code to another field.

I want to be able to tell my page to check the second field, and if the number exists (meaning they've already filled out the form), to redirect them to a page informing them of this.

Basically, 2 fields. One has a number already, the second gets the number after the user submits info. Bar user from reeentering information again.

Any idea?
 

sefskillz

shitting in the alley outside your window
there's alot more to that than just mysql. as far as the mysql is concerned you really only have to do the following:

select * from table where id=theirid;

which will give you all the info from the record that matches the id they entered, if the id is not found then you can just check if results were returned.

you could pull this off with a php script that just calls itself on form submittal and checks for post/get vars to know its state
 
Status
Not open for further replies.
Top Bottom