I've been programming with databases (Access) for about 2 years now and I've never had a mentor. So I've been learning this all on my own. My question is, is there a better way to select from a database and loop through the results than the way I currently do things?
My process:
$sql="SELECT * FROM table";
$rs=odbc_do($con,$sql);
while (odbc_fetch_row($rs))
{
$field_name_01 = odbc_result($rs, "field_name_01");
$field_name_02 = odbc_result($rs, "field_name_02");
$field_name_03 = odbc_result($rs, "field_name_03");
$field_name_04 = odbc_result($rs, "field_name_04");
$field_name_05 = odbc_result($rs, "field_name_05");
}
Say, I don't know all the field names. Is there a way to get all the data from the select, etc?
Thanx for any suggestions that might come my way.