$_GET not recognised in SQL statements
I have a couple of SQL statements which I'm struggling with. I'm passing a variable called 'lea' in the url, but when I try and 'get' it using SQL it seems to ignore it.
I know the variable is set as if I print it to the screen it displays correctly.
The first statement is
I haven't had this problem with other similar statements.
select * from table where column = '".$_GET['lea']."'
The other statement is an insert
Again no problems with other similar statements. The insert seems to simply ignore this and insert the default value of 0, but the select returns an error stating an error in in SQL syntax:
insert into table (site_id, site_name) values ('".$_GET['lea']."','".$_POST['sitename']."')
so it effectively can't see the $_GET variable?
select * from table where column =