conidig Posted March 24, 2013 Share Posted March 24, 2013 hi guys, i can't resolve this error "The requested URL /<br /><b>Warning</b>: mysql_fetch_array() expects parameter 1 to be resource, boolean given in <b>/home/nerdto/greenfair/include/bit_functions.inc.php</b> on line <b>33</b><br />//auction/ was not found on this server." where is the problem? thanks function getStart($limit) { if((!isset($_GET['page'])) || ($_GET['page'] == "1")) { $start = 0; $_GET['page'] = 1; } else { $start = ($_GET['page']-1) * $limit; } return $start; } function get_cat_name($cat) { $rec=mysql_fetch_array(mysql_query("select name,top from add_category where id=$cat")); if($rec['top'] > 0) { return get_cat_name($rec['top'])."/".str_replace(" ","-",trim($rec['name'])); } else return str_replace(" ","-",trim($rec['name'])); } Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/ Share on other sites More sharing options...
Solution haku Posted March 24, 2013 Solution Share Posted March 24, 2013 (edited) Assuming this is line 33 (you didn't say): $rec=mysql_fetch_array(mysql_query("select name,top from add_category where id=$cat")); Change it to this: $rec = mysql_query("select name,top from add_category where id=$cat") OR die(mysql_error()); Then run it and let us know what the error is. Edited March 24, 2013 by haku Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420671 Share on other sites More sharing options...
conidig Posted March 24, 2013 Author Share Posted March 24, 2013 Assuming this is line 33 (you didn't say): $rec=mysql_fetch_array(mysql_query("select name,top from add_category where id=$cat")); Change it to this: $rec = mysql_query("select name,top from add_category where id=$cat") OR die(mysql_error()); Then run it and let us know what the error is. thanks so much, it is a featured product slider i resolved it simply adding a product to it but now i have another problem while trying to register as user Unknown column 'ip' in 'field list'insert into user (id,gender,first_name,last_name,uname,bday,country,password,email,ccode,ip,stat_date) values('','male','myname','mysurname','myusername','mybirthdate','','mypassword','myemail','5b73b8ccdb','82.61.52.40',now()) Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420693 Share on other sites More sharing options...
haku Posted March 24, 2013 Share Posted March 24, 2013 You are trying to insert data into a database column called 'ip' which doesn't exist. Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420694 Share on other sites More sharing options...
conidig Posted March 24, 2013 Author Share Posted March 24, 2013 (edited) You are trying to insert data into a database column called 'ip' which doesn't exist. yes i checked in phpadmin and there isn't "ip", i tried to remove it from register page but show me another error... how can i create it? done, thanks Edited March 24, 2013 by conidig Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420699 Share on other sites More sharing options...
conidig Posted March 24, 2013 Author Share Posted March 24, 2013 if i can i would like to ask another question i'm configuring an auction website... but the website display this error, 500 Internal Server Error it is a subdomain so i'm not really convinced that i configured it correctly $config = array( 'Database' => array( 'driver' => 'mysql', 'persistent' => false, 'host' => 'localhost', // MySQL Hostname, usually 'localhost' 'login' => 'xxxx_admin', // MySQL Username 'password' => 'xxx', // MySQL Password 'database' => 'xxxx_bid', // MySQL Database Name 'prefix' => '', // not usually required, leave blank 'encoding' => 'utf8' ), // ******************************************************************************************* 'App' => array( 'license' => 'xxxx', // Paste your license key 'encoding' => 'UTF-8', 'baseUrl' => 'http://bid.xxx.com' // Required only if using subdomain/folder 'base' => 'http://bid.xxxx.com' // Required only if using subdomain/folder 'dir' => '/home/xxx', // Required only if using subdomain/folder 'webroot' => 'webroot', 'name' => 'Site Title Here', 'url' => 'http://www.bid.xxx.com' // fill this out 'ref_url' => 'http://www.bid.xxx.com' // fill this out 'nml_url' => 'http://www.bid.xxx.com' // fill this out 'serverName' => '', // this isn't usually needed 'timezone' => 'London/England', // check the Time Zone article in the Knowledge Base for the correct syntax 'language' => 'eng', // Three-letter only, eng = English. 'email' => 'inf@xxx.com', // fill this out and change it to desired email 'currency' => 'USD', // Three-letter currency code, i.e. GBP, USD, CAD. For other currencies, please see Knowledge Base Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420708 Share on other sites More sharing options...
haku Posted March 24, 2013 Share Posted March 24, 2013 500 errors are generally (maybe always, though I'm not confident enough to say for sure) at the server level, not the PHP level. Check your server (Apache if you are using it) error logs for more information. Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420710 Share on other sites More sharing options...
conidig Posted March 24, 2013 Author Share Posted March 24, 2013 (edited) [sun Mar 24 13:49:31 2013] [alert] [client 82.61.52.40] /home/xxxx/xxxxx/.htaccess: </files> without matching <files> section what does it mean? this is .htaccess <IfModule mod_rewrite.c> RewriteEngine on RewriteRule (.*\.(png|gif|jpg|jpeg|js|css|swf))$ webroot/img_handler.php?arg=$1 [L] RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> # disable directory browsing -IMPORTANT, do NOT remove. Options -Indexes # protect the htaccess file <files .htaccess> order allow,deny deny from all </files> # disable the server signature ServerSignature Off # protect php.ini #<files *.ini> order allow,deny deny from all </files> Edited March 24, 2013 by conidig Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420713 Share on other sites More sharing options...
haku Posted March 24, 2013 Share Posted March 24, 2013 You see this: #<files *.ini> The # sign comments out hte line - meaning it's not read by the system. This means you have a closing files tag (that comes below this line), but no opening files tag (which is what the error is telling you) Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420719 Share on other sites More sharing options...
conidig Posted March 24, 2013 Author Share Posted March 24, 2013 You see this: #<files *.ini> The # sign comments out hte line - meaning it's not read by the system. This means you have a closing files tag (that comes below this line), but no opening files tag (which is what the error is telling you) thanks but now show a blank page, can you check the php above? Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420720 Share on other sites More sharing options...
haku Posted March 24, 2013 Share Posted March 24, 2013 Time to start a new thread mate Quote Link to comment https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/#findComment-1420725 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.