Hi All,

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

Code:
select * from table where column = '".$_GET['lea']."'
I haven't had this problem with other similar statements.

The other statement is an insert

Code:
insert into table (site_id, site_name) values ('".$_GET['lea']."','".$_POST['sitename']."')
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:

Code:
select * from table where column =
so it effectively can't see the $_GET variable?

Any ideas?