Quote:
Originally Posted by tangoforce
Should be this:
"SELECT id, email, key FROM friendko_text WHERE key = '$_POST[key]'";
|
Quote:
Originally Posted by Fou-Lu
That should work, and even without error if I'm not mistaken.
But I don't like that. The 'key' in my eyes is now a constant which should be a string.
What I mean is to do as:
PHP Code:
$query = "SELECT id, email, key FROM friendko_text WHERE key = {$_POST['key']}"; // or $query = "SELECT id, email, key FROM friendko_text WHERE key = " . $_POST['key'];
|
Having looked at this post again, the only way 'key' could become a constant in my example string is if you're thinking that my double quotes were just used to quote a string and not to show the quotes as part of the code. I did however leave a semicolon there to show that it should be seen as code.
I would like to clarify that my double quotes were supposed to be included as part of the code and NOT just to show the SQL itself. I should have used php code tags but I was in a rush.