boionfire81 Posted March 13, 2016 Share Posted March 13, 2016 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; } Quote Link to comment Share on other sites More sharing options...
Coly010 Posted March 13, 2016 Share Posted March 13, 2016 Your variable is called $check. Your passing $checks to mysql_fetch_array. Also, look into mysqli Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 13, 2016 Author Share Posted March 13, 2016 change to mysqli now its PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given (2) This is the same code as used in another upload form. Not sure what I'm missing Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted March 13, 2016 Share Posted March 13, 2016 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 } Quote Link to comment Share on other sites More sharing options...
boionfire81 Posted March 13, 2016 Author Share Posted March 13, 2016 Just trying to tweak this mod http://makewebgames.io/forum/game-engines/mccode-development-support/free-modifications/2025-mccode-v2-profile-image-uploader change the path and changed display_pic to gangFLAG Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.