Unanswered: variables in sql queries: a very easy question
these are two examples of a book ive been reading:
$query = "SELECT * FROM region WHERE " . "region_id = $regionID";
$insertQuery = "INSERT INTO region VALUES (NULL, " . "\"" . $regionName . "\")";
ive got a little confusion nibbling at me - in the first example the PHP variable is included in the query string as is (im assuming the string concats exist because of the space limitations on the printed page of the book?)... yet in the second its placed outside the query string. the only difference i can tell is that one is a numeric value and the other a string - is this the difference? could someone please briefly explain the rules to me? it would be much appreciated as my text is proving a little ambiguous.