Is there a way to access fields of a SQL table in a generic manner?
Lets say you have a table with this description:
Code:
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| invoice | varchar(10) | | PRI | | |
| cardno | varchar(25) | YES | | NULL | |
| name | varchar(25) | YES | | NULL | |
| expdate | varchar(5) | YES | | NULL | |
| city | varchar(25) | YES | | NULL | |
| radio | varchar(25) | YES | | NULL | |
| email | text | YES | | NULL | |
| address | varchar(25) | YES | | NULL | |
| ipaddress | varchar(15) | YES | | NULL | |
| status | char(1) | | | | |
| time | varchar(10) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
How would I query this table using generic specifiers in place of the field names?
Something like:
select * from TABLE where TABLE.f1='1234' and where TABLE.f2='5678';
Is there some sort of dot-notation that I can use to generically access the table's fields?
Thanks...