Formatting mySQL Statements
Posted: Wed Jan 18, 2006 6:34 am
Quick Question:
Is it better/worse/pointless for including the table name in the sql statement as a standard, even if not lisiting for an inner join.
example
option 1
OR
option 2
Yes there is no inner join here, however im trying to formulate a standard. is there any benifit of option 1?
Is it better/worse/pointless for including the table name in the sql statement as a standard, even if not lisiting for an inner join.
example
option 1
Code: Select all
$get_price_info_list_returned = mysql_query ("
SELECT bwc_products_price.products_price_id,
bwc_products_price.products_type_id,
bwc_products_price.products_price,
bwc_products_price.products_price_quickfind_code,
bwc_products_price.products_price_kfc_code,
bwc_products_price.products_price_quantity,
bwc_products_price.products_price_detail
FROM bwc_products_price
WHERE bwc_products_price.products_price_id = '$products_number_list_array[$random_number_for_products]' LIMIT 0,1", $connection) or die ("Error: home.php - bwc_products_price lookup");option 2
Code: Select all
$get_price_info_list_returned = mysql_query ("
SELECT products_price_id,
products_type_id,
products_price,
products_price_quickfind_code,
products_price_kfc_code,
products_price_quantity,
products_price_detail
FROM bwc_products_price
WHERE bwc_products_price.products_price_id = '$products_number_list_array[$random_number_for_products]' LIMIT 0,1", $connection) or die ("Error: home.php - bwc_products_price lookup");