Jump to content

Select an entire database


hansman

Recommended Posts

Hello i have a login form with username and password fields.

 

The login will work if i do this

 

 

$sql="SELECT * FROM AK WHERE name='$myusername' and pass='$mypassword'";

 

however, i need to select the entire database(states) so i did this..

 

$table = "AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, MT, NC, ND, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, SD, TN, TX, UT, VA, VT, WA, WI, WV, WY";

$sql="SELECT * FROM $table WHERE name='$myusername' and pass='$mypassword'";

 

The form will not work with that above.

 

 

any ideas?

Link to comment
https://forums.phpfreaks.com/topic/115054-select-an-entire-database/
Share on other sites

Can you not simply change all those tables to:

UserID UserPassword etc etc State

and move all records into this new table!

 

The way it is currently done doesn't really cover "Normalised Data!"

 

Let me know what you think,

Matt

Rather or not it's Normalized, you are showing the potential to run into serious problems in the future.

 

If there is a single login point that checks a username and password against ALL states ... is there ever going to be the possibility that a person in Tennessee will have the same login name as a person in Florida?

 

If so, how do you know which person is trying to login? And if there password is valid?

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.