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


 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.