Jump to content

Safety conditional search in a students database


moisesbr

Recommended Posts

Hi

 

I have a database where some students don't have their Identity_number stored , but all students have a code.

 

I am trying to implement a search in this database with some degree of safety.

 

In first html page, both fields are mandatory (because everbody has an Identity_number to type )

 

$result = mysql_query("SELECT * FROM certificado WHERE Identity_number= '$cpf'") or die (mysql_error()); 

 

If found Identity_number, compare certificado.code with $code and show (html result - a already have) if match.

However if Identity_number is not found, then search only by code. ( because nobody will guess student does not have Identity_number in database .)

 

Is it easy to do such a code ? I need help at least with $result  mysql lines.

Moises


 

Edited by moisesbr
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.