Rephrase the question so it makes some sort of sense.
$_GET is not a function, $_GET('number') is invalid syntax.
$_GET['number'] will return the string from the get request that was
prefixed with "(?|&)number= up to but not including the end of the
request or the next "&" whichever comes first.
If you're trying to use the string value as a numeric value in a query,
then you may not want to put quotes round it in the query string:
select * from table where column = '42'; // looks for a string
select * from table where column = 42; // looks for a number
As the value you get from the request is a string, and the sql command is
a string, you could just copy the string value across, or you could force
it to a number and back in the process, which might be slightly slower,
but would be a lot safer:
num = -1;
if (isset($_GET['number'])) num = intval($_GET['number'])
if ( num > 0 ) {
sql = "select * from table where column = {$num}";
}
else {
// handle invalid number here
}
But all of this presumes that your issue is that you are comparing a
string value with an integer field, and that's why you're not getting the
result you expect - however you really haven't presented enough
information about the problem - and if your issue is a mysql one, perhaps
you need to ask in a mysql group.
--
Denis McMahon,
denismf...@gmail.com