Jump to content

mysql_fetch_array() error


conidig

Recommended Posts

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']));
 
}

 

Link to comment
https://forums.phpfreaks.com/topic/276079-mysql_fetch_array-error/
Share on other sites

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.

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())

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'                  => '[email protected]', // 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

[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>

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.