Jump to content

If (I == "don\'t understand") { echo "HELP"; }


lordphate

Recommended Posts

What im wanting to do is if clb_id turns up 0 then display normal rooms but if clb_id equals a number then display the normal rooms plus the name of clb_id's room

 

<?php

mysql_connect('localhost','arshem','firestorm');
mysql_select_db('dzoic');

$query = "SELECT clb_id FROM flashchat_rooms WHERE id=".$room_id;
$result = mysql_query($query);
$clb_id = @mysql_result($result,0);

IF( $clb_id == "" ){
	  $stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NOT NULL AND ispermanent IS NOT NULL ORDER BY ispermanent");
			if($rs = $stmt->process()) {
				while($rec = $rs->next()) {
					$this->addRoom($rec, $rooms, $room_pass);
				}
  				}
                 }
       else {
       $stmt = new Statement("SELECT * FROM {$GLOBALS['fc_config']['db']['pref']}rooms WHERE ispublic IS NULL AND ispermanent IS NOT NULL AND clb_id=". $clb_id ."ORDER BY created");
			if($rs = $stmt->process())
		  	{
					while($rec = $rs->next())
			  		{
						$this->addRoom($rec, $rooms, $room_pass);
				  	}
				}

                   }
?>

 

Link to comment
Share on other sites

Replace

 

$result = mysql_query($query);

 

with

 

$result = mysql_query($query) or die("Error in $query\n" . mysql_error());

 

And remove the "@" from mysql_result().  If you don't get any errors, add this line below the mysql_result() line:

 

var_dump($clb_id);

 

and post what you see :)

Link to comment
Share on other sites

btherl,

 

It stalls the chat system. Now, if i use the code i provided, regular chat works perfectly fine, but when i'm trying to enter a "club" chat it says i've entered "null"

 

Login via arshem @ comcast .net // firestorm

 

then use this URL  :  http://www.indianaparents.net/index.php?page=chat&username=phate&password=6b3686598cc84a6709ca23e8477d8de9&room=2

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.