About 1 result: "mysql_query repo:gregorytoullie/php-q-source-snircd"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On
q_register.php in php-q-source-snircd https://bitbucket.org/gregorytoullie/php-q-source-snircd | 671 lines | PHP
  1. 		if($link){
  2. 			@mysql_query("USE q",$link);
  3. 			# Ici nous supprimons les salons orphelins de mysql
  4. 			$results = mysql_query("SELECT * FROM `channels`",$link);
  5. 					if(!array_key_exists(strtolower($table['name']),self::$channels)){
  6. 						mysql_query(sprintf("DELETE FROM channels WHERE `name`='%s';",$table['name']),$link);
  7. 			$name = mysql_real_escape_string($name);
  8. 			$results = mysql_query(sprintf("SELECT * FROM `channels` WHERE name='%s'",$name),$link);
  9. 				# injection des nouveaux canaux
  10. 				mysql_query(sprintf("INSERT INTO `channels` (`id`,`name`,`created`,`founder`,`adder`,`chantype`,`chanmode`,`chanflags`,`chanlev`,`welcome`,`topic`) VALUES ('%d','%s','%d','%s','%s','%s','%d','%d','%s','%s','%s')",
  11. 				$last = mysql_fetch_assoc($results);
  12. 				if($values['topic']!==$last['topic']){mysql_query(sprintf("UPDATE `channels` SET `topic`='%s' WHERE `name`='%s'",mysql_real_escape_string($values["topic"]),$name),$link);}
  13. 				if($values['welcome']!==$last['welcome']){mysql_query(sprintf("UPDATE `channels` SET `welcome`='%s' WHERE `name`='%s'",mysql_real_escape_string($values["welcome"]),$name),$link);}
  14. 				if($values['chanmode']!==$last['chanmode']){mysql_query(sprintf("UPDATE `channels` SET `chanmode`='%s' WHERE `name`='%s'",$values["chanmode"],$name),$link);}
  15. 				if($values['chanflags']!==$last['chanflags']){mysql_query(sprintf("UPDATE `channels` SET `chanflags`='%d' WHERE `name`='%s'",$values["chanflags"],$name),$link);}

Back to Top