Boolean given help

Sab

I love milfs.
Jun 25, 2011
1,212
136
I get this error in my housekeeping:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\app\tpl\skins\Custom-Habbo\hk\jobs.html on line 43

This is the link 43 in HK:


Code:
 $getMySQL = mysql_query("SELECT * FROM `jobs` ");                    $alternate = 1;                    while ($data = mysql_fetch_array($getMySQL)) {                        if($alternate == 0) {                        $alternate = 1;                        echo "<tr style=\"background-color: #4FD9EF;\">";                        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                        echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                        echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                                                                                                echo "</tr>";                        }                        else if($alternate == 1) {                        $alternate = 0;                                                echo "<tr style=\"background-color: #2DB8CD;\">";                        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                        echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                        echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                        echo "</tr>";                        }                    }                ?> </table> </p></div> </div>


It's all 1 line, just looks like that on here. (I'm not so good at coding)
 

TyleRJc

Member
Jun 19, 2011
67
12
PHP:
 $getMySQL = mysql_query("SELECT * FROM `jobs` ");                 
$alternate = 1;                 
  while ($data = mysql_fetch_array($getMySQL)) {                     
    if($alternate == 0) {                     
        $alternate = 1;                     
        echo "<tr style=\"background-color: #4FD9EF;\">";                   
        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                     
        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                   
        echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                     
        echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                     
        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                     
        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                                                                                             
        echo "</tr>";                     
    } else if($alternate == 1) {                     
        $alternate = 0;                                             
            echo "<tr style=\"background-color: #2DB8CD;\">";                     
            echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                   
            echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                     
            echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                     
            echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                     
            echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                     
            echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                     
            echo "</tr>";                     
        }                 
    }             
    ?>
    </table> </p></div> </div>

Alot better.
Database config'd?
try changing mysql_fetch_array($getMySQL) to mysql_fetch_assoc($getMySQL)
 

Sab

I love milfs.
Jun 25, 2011
1,212
136
PHP:
 $getMySQL = mysql_query("SELECT * FROM `jobs` ");               
$alternate = 1;               
  while ($data = mysql_fetch_array($getMySQL)) {                   
    if($alternate == 0) {                   
        $alternate = 1;                   
        echo "<tr style=\"background-color: #4FD9EF;\">";                 
        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                   
        echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                 
        echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                   
        echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                   
        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                   
        echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                                                                                           
        echo "</tr>";                   
    } else if($alternate == 1) {                   
        $alternate = 0;                                           
            echo "<tr style=\"background-color: #2DB8CD;\">";                   
            echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['username'] . "</td>";                 
            echo "<td style=\"width: 12.5%;background-color: #4FD9EF;\">" . $data['job'] . "</td>";                   
            echo "<td style=\"width: 37.5%;background-color: #4FD9EF;\">" . $data['why'] . "</td>";                   
            echo "<td style=\"width: 20%;background-color: #4FD9EF;\">" . $data['experience'] . "</td>";                   
            echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['age'] .  "</td>";                   
            echo "<td style=\"width: 30%;background-color: #4FD9EF;\">" . $data['other'] .  "</td>";                   
            echo "</tr>";                   
        }               
    }           
    ?>
    </table> </p></div> </div>

Alot better.
Database config'd?
try changing mysql_fetch_array($getMySQL) to mysql_fetch_assoc($getMySQL)
Same thing.
 

Sab

I love milfs.
Jun 25, 2011
1,212
136
I added Tylers version of the code,
The error is line 45 now, this is line 45: while ($data = mysql_fetch_assoc($getMySQL)) { 
## Phoenix 3.0 System Configuration File

## Licence Information
Otaku-Studios.username=
Otaku-Studios.password=

## MySQL Configuration
db.hostname=127.0.0.1
db.port=3306
db.username=root
db.password=
db.name=

## MySQL pooling setup (controls amount of connections)
db.pool.minsize=5
db.pool.maxsize=30

## Game TCP/IP Configuration
game.tcp.conlimit=5000

## Client configuration
client.ping.enabled=1
client.ping.interval=30000

## MUS TCP/IP Configuration
mus.tcp.bindip=127.0.0.1
mus.tcp.allowedaddr=127.0.0.1

## Console Configuration
emu.messages.connections=1
emu.messages.roommgr=0
 

TyleRJc

Member
Jun 19, 2011
67
12
Replace
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ");             
$alternate = 1;             
  while ($data = mysql_fetch_array($getMySQL)) {
with
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ORDER BY id");             
$alternate = 1;             
  while ($data = mysql_fetch_assoc($getMySQL)) {
 

Sab

I love milfs.
Jun 25, 2011
1,212
136
Replace
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ");           
$alternate = 1;           
  while ($data = mysql_fetch_array($getMySQL)) {
with
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ORDER BY id");           
$alternate = 1;           
  while ($data = mysql_fetch_assoc($getMySQL)) {
Same thing.
 

TyleRJc

Member
Jun 19, 2011
67
12
I feel retarded. I was wondering why yah asked for the database, forgot all about the CMS database. :p

PHP:
<?php
if(!defined('IN_INDEX')) { die('Sorry, you cannot access this file.'); }
#Please fill this all out.
 
#NOTE: To set up TheHabbos.ORG's API go to wwwroot/mysite/thehabbos_api for IIS, OR, htdocs/thehabbos_api for XAMPP and others.
 
/*
*
*    MySQL management
*
*/
 
$_CONFIG['mysql']['connection_type'] = 'pconnect'; //Type of connection: It must be connect, or pconnect: if you want a persistent connection.
 
$_CONFIG['mysql']['hostname'] = 'localhost'; //MySQL host
 
$_CONFIG['mysql']['username'] = 'root'; //MySQL username
 
$_CONFIG['mysql']['password'] = 'MYPASSWORD'; //MySQL password
 
$_CONFIG['mysql']['database'] = 'MYDB'; //MySQL database
 
$_CONFIG['mysql']['port'] = '3306'; //MySQL's port
 
/*
*
*    Hotel management  - All URLs do not end with an "/"
*
*/
 
$_CONFIG['hotel']['server_ip'] = '24.131.62.42'; //IP of VPS/DEDI/etc
 
$_CONFIG['hotel']['url'] = 'http://sharp-hotel.no-ip.org'; //Does not end with a "/"
 
$_CONFIG['hotel']['name'] = 'Sharp'; // Hotel's name
 
$_CONFIG['hotel']['desc'] = 'Where The Fun Begins!'; //Hotel's description
 
$_CONFIG['hotel']['email'] = '[email protected]'; //Where the help queries from users are emailed to.@Priv skin
 
$_CONFIG['hotel']['in_maint'] = false; //False if hotel is NOT in maintenance. True if hotel IS in maintenance
 
$_CONFIG['hotel']['motto'] = 'Sharp-Hotel: New user'; //Default motto users will register with.
 
$_CONFIG['hotel']['credits'] = 10000; //Default number of credits users will register with.
 
$_CONFIG['hotel']['pixels'] = 500; //Default number of pixels users will register with.
 
$_CONFIG['hotel']['figure'] = 'hr-125-31.ch-215-62.hd-209-8.lg-275-63'; //Default figure users will register with.
 
$_CONFIG['hotel']['web_build'] = '63_1dc60c6d6ea6e089c6893ab4e0541ee0/1458'; //Web_Build
 
$_CONFIG['hotel']['external_vars'] = 'http://24.131.62.42/r63/external_variables.txt'; //URL to your external
 
$_CONFIG['hotel']['external_texts'] = 'http://24.131.62.42/r63/external_flash_texts.txt'; //URL to your external texts
 
$_CONFIG['hotel']['product_data'] = 'http://24.131.62.42/r63/productdata.txt'; //URL to your productdata
 
$_CONFIG['hotel']['furni_data'] = 'http://24.131.62.42/r63/furnidata.txt'; //URL to your furnidata
 
$_CONFIG['hotel']['swf_folder'] = 'http://24.131.62.42/r63'; //URL to your SWF folder(does not end with a '/')
/*
*
*    Templating management - Pick one of our default styles or make yours by following our examples!
*
*/
 
#RevCMS has 2 default styles, 'Mango' by dannyy94 and 'Priv' by joopie - Others styles are to come, such as RastaLulz's ProCMS style and Nominal's PhoenixCMS 4.0 style.
 
$_CONFIG['template']['style'] = 'Custom-Habbo';
 
/*
*
*    Other topsites.. thing
*
*/
 
$_CONFIG['thehabbos']['username'] = 'SabBaftia';
$_CONFIG['retro_top']['user'] = '';
 
/*
*
*    Recaptcha management - Fill the information below if you have one, else leave it like that and don't worry, be happy.
*
*/
 
$_CONFIG['recaptcha']['priv_key'] = '6LcZ58USAAAAABSV5px9XZlzvIPaBOGA6rQP2G43';
$_CONFIG['recaptcha']['pub_key'] = '6LcZ58USAAAAAAQ6kquItHl4JuTBWs-5cSKzh6DD';
 
 
/*
*
*    Social Networking stuff
*
*/
 
$_CONFIG['social']['twitter'] = 'The_sharphotel'; //Hotel's Twitter account
 
$_CONFIG['social']['facebook'] = 'Sharp-Hotel'; //Hotel's Facebook account
 
 
?>
That isn't the databaseconfig.php in /hk/ folder, is it?
 

Sab

I love milfs.
Jun 25, 2011
1,212
136
I'm getting puzzled. Lets clear shit up.
In /app/tpl/skin/your skin/hk/ Have you got a file named databaseconfig.php?

PHP:
<?php
/*
Pluz ASE made by Ryan, With the help of "Grape ASE"
Twitter; @OtakuPluz
Original database config by, "Grapefruit"
Pluz ASE, Database Config (Please do not share this file with anyone, as it contain's your Database password.
If you get any issue's with Pluz ASE, please PM or Tweet me, Thanks.
*/
 
 
// Database config
$host = "localhost"; // Your database host, normaly localhost
$user = "root"; // Database username
$password = ""; // Your database password
$database = ""; // The name of the database on your server
 
 
 
mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
 
?>
 
That isn't the databaseconfig.php in /hk/ folder, is it?
Na, sorry got confused. :p Didn't really read your post.
 

TyleRJc

Member
Jun 19, 2011
67
12
PHP:
<?php
/*
Pluz ASE made by Ryan, With the help of "Grape ASE"
Twitter; @*****Pluz
Original database config by, "Grapefruit"
Pluz ASE, Database Config (Please do not share this file with anyone, as it contain's your Database password.
If you get any issue's with Pluz ASE, please PM or Tweet me, Thanks.
*/
 
 
// Database config
$host = "localhost"; // Your database host, normaly localhost
$user = "root"; // Database username
$password = ""; // Your database password
$database = ""; // The name of the database on your server
 
 
 
mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
 
?>
 

Na, sorry got confused. :p Didn't really read your post.
Hmm.. have you got any rows in the table jobs?

Replace
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ");

with
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ORDER BY id") or die(mysql_error());
 

Sab

I love milfs.
Jun 25, 2011
1,212
136
Hmm.. have you got any rows in the table jobs?

Replace
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ");

with
PHP:
$getMySQL = mysql_query("SELECT * FROM `jobs` ORDER BY id") or die(mysql_error());
When I did that, it ruined my whole housekeeping, I undo'd it.
 

Users who are viewing this thread

Top