registration form without password?

gargiulo
Posts: 3
Joined: 2010-04-28 08:23

registration form without password?

Post by gargiulo » 2010-09-01 17:04

Hi all,
I need to create a form that will insert data into a table (MYTABLE) in a mysql db.
I need to check that the field MYNAME and the field MYFIELD are unique.

No problem here.

In another page, in another form I need to check that MYNAME exists on the table MYTABLE and MYFIELD DOES NOT exist on the very same table (MYTABLE). How can I do this check with Kollection? I don't see anything like 'check if field exists'.

Any idea will be really appreciated.

TIA

tony

User avatar
Fred
Site Admin
Posts: 491
Joined: 2010-02-15 12:10
Location: Armagh, Northern Ireland
Contact:

Re: registration form without password?

Post by Fred » 2010-09-03 10:46

Can you give a bit more info on what you are trying to achieve?

For a simple check all you need to do is filter the record at the mysql level and check if the field is empty or not.

Lets say you want to show the submit button or redirect the user to a different page if MYFIELD contains data.

Code: Select all

SELECT * FROM MYTABLE WHERE MYNAME = colname
Colname would be set to a session variable where you store the unique value for myname

With this you can then apply a Show IF SB if the MYFIELD = '' or NULL, depending on the data-type.

Another way is to check at the mysql level if the field is empty.

Code: Select all

SELECT * FROM MYTABLE WHERE MYNAME = $_SESSION_myname AND MYFIELD = '' or
SELECT * FROM MYTABLE WHERE MYNAME = $_SESSION_myname AND MYFIELD != ''
Colname would be set to a session variable where you store the unique value for myname

Post Reply