For example:
I have the normal column name:
SELECT column FROM….
The way i retrieve it in PHP:
$var = $row["column"];
What i want to know is how to retrieve column records which are named with column and table:
SELECT table.column FROM…
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It works the exact same way, it’s not going to be prefixed with a table.
so if you do a
SELECT table.* FROM…, and one of the column names is tacos. you can still do$row['tacos'].Now, if you’re doing multiple tables (joins) it can get ambiguous if they have the same names, such as “id”. So you can alias them…
SELECT table.column as new_name FROM…