This may seem like a very basic and simple question from someone that has been doing programming as long as I have, but it is something that has always eluded me, and I've never taken the time to ask, so here it is...
When I am doing queries, I am constantly questioning the structure regarding using variables in the query..
Is there a simple rule to follow that would make sense to tell me 'In this instance you do this' and 'In that instance you do that'...?
An example of the variations I'm referring to...
INSERT INTO adm_period_trans(adm_trans_id, admin_id, period_id, cur_rate, trans_id) VALUES('', '$adm', '$period_id', '$adm', '$sent_id') OR INSERT INTO adm_period_trans(adm_trans_id, admin_id, period_id, cur_rate, trans_id) VALUES('', '".$adm."', '".$period_id."', '".$adm."', '".$sent_id".')
DOES it Matter?
And does it matter based on the operation? i.e. INSERT / UPDATE / SELECT
Clarification on this would be a wonderful thing...
Thanks in advance.