Example mysql_query:
$query=mysql_query(\"SELECT `col1`, `col2` FROM `table` WHERE `col1`=\'$escapedvariable\' \");
I know the above is not goo
No, you have to use mysqli-functions or PDO.