Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Register your account to receive email notifications when new services and mods are added.


This forum is now closed and has moved to a new location! Click here to find out why.

AuthorTopic: database grabbing not working.  (Read 569 times)

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
database grabbing not working.
« on: September 29, 2009, 03:03:20 PM »
I'm trying to make a mod for my own self and it is something that tells the site that it is offline or online. something that lets users know we are working on the site for some more editing. can you check this out and see if there is something wrong with it?

       $q=$db->query("SELECT * FROM settings",$c);
       if($r['online'] >= 1) { $on="<font color=green><b>Online</b></font>"; } else { $on="<font color=red><b>Offline</b></font>"; }

every time I configure the database with a 1 or 0, it keeps on saying offline and I couldn't get it working right. please help me because this is for a new template.
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: database grabbing not working.
« Reply #1 on: September 30, 2009, 02:05:26 PM »
Couple of things it could be:
1) have you globalized $db? if not add global $db;
2) Have you told php what $r is?
Logged
Project Choosen - 10%
Daniel - Hanson . Com

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
Re: database grabbing not working.
« Reply #2 on: September 30, 2009, 03:02:16 PM »
I'll try it and give a report.
Logged

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
Re: database grabbing not working.
« Reply #3 on: September 30, 2009, 03:23:02 PM »
it doesn't work. I tried the $r thing and it didn't work like it is supposed too.
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: database grabbing not working.
« Reply #4 on: October 01, 2009, 09:16:39 AM »
pm me your code if you wanna.
Logged
Project Choosen - 10%
Daniel - Hanson . Com
 


This forum is now closed and has moved to a new location! Click here to find out why.