I’m trying to get information from mysql database using GET id.
I use the following code to check what the id is.
$qry = "SELECT name,country FROM databasetable WHERE uid=$id";
I get error which means that it couldn’t find any entry with the specified uid. If I change the uid to only to numbers, then it works can look it up. Example: ?id=1000000000 works fine, ?id=1kKV0LEfMi . Can’t be found Please help me
You need to change your query to have single quotes around the uid value like this
That being said you also really need to look into using the newer MySQL connection support (not the mysql_* functions) and you need to learn how to escape your data so you protect against SQL injection.