$_GET not being recognised by SQL statements
Posted: Wed Jan 05, 2005 4:09 am
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
I haven't had this problem with other similar statements.
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:
so it effectively can't see the $_GET variable?
Any ideas?
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 all
select * from table where column = '".$_GETї'lea']."'The other statement is an insert
Code: Select all
insert into table (site_id, site_name) values ('".$_GETї'lea']."','".$_POSTї'sitename']."')Code: Select all
select * from table where column =Any ideas?