January 13th, 2013, 11:18 PM
Join Date: Dec 2012
Time spent in forums: 11 h 36 m 11 sec
Reputation Power: 1
PHP-DB - Checking $_GET
There's probably some simple fundamental solution that I'm missing to solve my problem so please throw me a bone.
Let's say I have a dynamic url's setup to display user profiles based on a number that corresponds to a particular profile.
Now let's say 6 does not correspond to any userprofile. If you were to manually navigate to domain.com/?userprofile=6 the resulting page would be blank.
How would I go about checking to see if the sql query corresponding to 6 comes back empty, so that i can either send a redirect or error?
$query = mysql_query("SELECT * FROM `users` WHERE `uploadID` = '$uploadID'");
I have have tested numerous values in if statements, such as:
if($query === 0)
I have also checked to see if an array holding the query data was empty, which didn't work either.