Jump to content

Confusion on row names


Xtremer360

Recommended Posts

Say I have:

 

$query="SELECT h.password as password,h.enabled as enabled FROM efed_handler as h WHERE h.login='$uname' and h.fed_id='$fedid'";

 

I'm about to create the tables in my database and know obviously that the name of one of my tables need to be called efed_handler. Little confused on the row names though.

Link to comment
https://forums.phpfreaks.com/topic/182727-confusion-on-row-names/
Share on other sites

That can be simplified to:

$query="SELECT password,enabled FROM efed_handler WHERE login='$uname' and fed_id='$fedid'";

"password", "enabled", "login" and "fed_id" would be your column names. There's nothing wrong with the way you had it originally but you only need to specify the table names before column names when you're accessing more than one table at the same time.

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.