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
https://forums.phpfreaks.com/topic/54375-if-i-dont-understand-echo-help/
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 :)

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

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.