Jump to content
MakeWebGames

[v2] Gang Flag Upload


Recommended Posts

So I'm tweaking the profile pic upload to upload and display a gang flag

But I'm getting this error

 

A critical error has occurred, and page execution has stopped. Below are the details:

PHP Warning: mysql_fetch_array() expects parameter 1 to be resource, null given (2)

Snippet area

/*Check DB*/
   $check = mysql_query(
   sprintf("SELECT COUNT(*) as cnt FROM `users` WHERE `gangFLAG` = '%s'",
   mysql_real_escape_string($picture)));

   $checks = mysql_fetch_array($checks);

   if ($checks['cnt'] > 0) {
       echo 'Please use another image name
Back';
       $h->endpage(); exit;
   }
Link to comment
Share on other sites

As Coly said you are passing the variable $checks to the fetch array which is the variable your creating you need to pass the variable that holds the query which you used $check

i think you have got yourself confused when adding it i would suggest if you are going to name variables like this then shorten the one on the fetch

$check = mysql_query("some query");

$ch = mysql_fetch_array($check);

if($ch['something']) {

run code

}

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...