Re: [PHP-DB] Accessing fields with the same name in MySQL

2001-09-04 Thread Joe Strano
Don't do a SELECT *. Instead, list out the columns you want to select. When you choose the ID columns, alias them. For example: SELECT tbl_job.id job_id, tbl_name.id name_id, . . . . . . A better option, if you have it, is to change your naming conventions in your database.

RE: [PHP-DB] Accessing fields with the same name in MySQL

2001-08-28 Thread Walter, Marcel
You have two times the field id Look at your query ... especially the Where-Clause .. You only want to show Recordsets where id = id ... = In both columns is the same value ... -Original Message- From: Trevor Lanyon [SMTP:[EMAIL PROTECTED]] Sent: Monday, August 27, 2001 20:13

RE: [PHP-DB] Accessing fields with the same name in MySQL

2001-08-27 Thread Rick Emery
Since you're matching on id, why does it matter which table it came from? It came from both. Perhaps, I do not understand your question. rick -Original Message- From: Trevor Lanyon [mailto:[EMAIL PROTECTED]] Sent: Monday, August 27, 2001 1:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB]

RE: [PHP-DB] Accessing fields with the same name in MySQL

2001-08-27 Thread Howard Picken
You could try returning the whole info with an alias i.e. select tbl_job.id AS jobno, tbl_job.name.id, tbl_job.job, tbl_name.* from tbl_name, tbl_job where tbl_name.id = tbl_job.name_id; You should then be able to refer to the tbl_job.id as jobno in any $row function i.e.