lordphate Posted June 6, 2007 Share Posted June 6, 2007 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 More sharing options...
btherl Posted June 6, 2007 Share Posted June 6, 2007 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 https://forums.phpfreaks.com/topic/54375-if-i-dont-understand-echo-help/#findComment-268910 Share on other sites More sharing options...
lordphate Posted June 6, 2007 Author Share Posted June 6, 2007 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 https://forums.phpfreaks.com/topic/54375-if-i-dont-understand-echo-help/#findComment-268921 Share on other sites More sharing options...
btherl Posted June 6, 2007 Share Posted June 6, 2007 That makes it difficult.. as we can't see output from the script. Are you able to call your script directly for testing purposes? Link to comment https://forums.phpfreaks.com/topic/54375-if-i-dont-understand-echo-help/#findComment-268926 Share on other sites More sharing options...
lordphate Posted June 6, 2007 Author Share Posted June 6, 2007 Not really..I can maybe send you the script if you want. Link to comment https://forums.phpfreaks.com/topic/54375-if-i-dont-understand-echo-help/#findComment-268931 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.