Mysql error help

January 25th, 2020

u must be know the famous topic
How I make $25 a day from Google Adsense
can any one would help me in solving the error here it is

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/mittal/public_html/includes/application_top.php on line 14
No Categories.

and here is the my website.
http://mittal.x10hosting.com/
plz help

Answer #1
is this a script ? if so you have not installed it correctly or you have messed up while customizing it
Answer #2
Can you please post the query?
Answer #3
I’m no pro on SQL. But it could be you haven’t made the right tables in SQL, so it can’t fetch it. Also try look on the line 14 application_top.php
I do not know this famous script…
Answer #4
Don’t look at line 14. That’s not the line we’re looking for. The error is before line 14. Look for something like: mysql_query(“xyz”);
That’s what we need.
Answer #5
here is the script off application_top.php plz help me out….
<?php
include('config.php');
include('functions.php');
    // Connect to database
$dbConnection = mysql_pconnect(DATABASE_HOST, DATABASE_USER, DATABASE_PASS) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db(DATABASE_NAME, $dbConnection);
// set the application parameters
  $configuration_query = mysql_query('select name as cfgKey, value as cfgValue from ' . TABLE_PREFIX . 'configuration');
  while ($configuration = mysql_fetch_array($configuration_query)) {
    define($configuration['cfgKey'], $configuration['cfgValue']);
  }
      // Get parameters
$keyword=db_prepare_input($_GET['k']);
$category=db_prepare_input($_GET['c']);
$page=db_prepare_input($_GET['p']);
  // Get category info if specified
if (!empty($category)){
     // Get Category Colour and Image
   // Check if keyword exists in database
   $cat_query_sql = "select * from " . TABLE_PREFIX . "categories where id='" . $category . "'" ;
   $cat_query = mysql_query($cat_query_sql) ;
   $cat = mysql_fetch_array($cat_query);
}
 
// Get category info if specified
if (!empty($keyword)){
   $keyword_query_sql = "select * from " . TABLE_PREFIX . "keywords where id = '" . $keyword . "'";
   $keyword_query = mysql_query($keyword_query_sql) ;
   $keyword_row = mysql_fetch_array($keyword_query);
   $num_keyword_rows = mysql_num_rows($keyword_query);
           //if ($num_keyword_rows==0) {
      //die ('Invalid Keyword Specified.');
   //}
}
  // Within a Category
if (!empty($category)){
   if ($cat['useimage'] ==1){ // Default image
      $catimage='images/categories/titleimage.jpg';
   }
   elseif ($cat['useimage'] ==2){// Uploaded image
      $catimage='images/categories/' . $cat['image'];
   }
   else {
      $catimage='';
   }
}
else { // Main page
   if (CFG_USEIMAGE==1) {
      $catimage = 'images/categories/titleimage.jpg';
   }
   elseif (CFG_USEIMAGE==2 && CFG_IMAGE !='' && file_exists('images/categories/' . CFG_IMAGE)){
      $catimage= 'images/categories/' . CFG_IMAGE;
   }
   else {
      $catimage='';
   }
}
// Set page title
if (!empty($cat['category'])){
   $title=$cat['category'];
}
else {
   
   $title = CFG_TITLE;
}
// Use colour if specified, else use default
if (!empty($cat['colour'])){
   $catcolour=$cat['colour'];
}
else {
   $catcolour= CFG_COLOUR;
}
          ?>

 

| Sitemap |