View Full Version : variable labeling inside a query

04-16-2012, 04:18 PM
A quick question:

If there is only one place in my database with the column name "apples" then I do not have to include the table name before the $apples variable in my INSERT query, is that correct?

04-16-2012, 04:55 PM
If it never causes a conflict, and isn't a reserved word, then no you don't need to prepend the field with the table.
Although, since a lot of field names are reused between multiple tables, especially ones with relationships, a table name or alias is required during joins so it knows which table to draw from. For consistencies sake, that alone is a reason to always use a table.field syntax.

04-16-2012, 04:57 PM
Ok thank you!