About 15 results: "mysql_query repo:beakid/md"
Page 1 of 1
Filter Results
Sources
Languages
Filter Results
Try Search On

draft_functions.php in md https://github.com/beakid/md.git | 217 lines | PHP
  1. 	//make draft_name
  2. 	$draft_name_result = mysql_query("SELECT exp_shortname FROM md_exp WHERE pk_exp_id = $pack1 UNION ALL SELECT exp_shortname FROM md_exp WHERE pk_exp_id = $pack2 UNION ALL SELECT exp_shortname FROM md_exp WHERE pk_exp_id = $pack3");
  3. 	//insert data for now
  4. 	mysql_query("INSERT INTO md_draft(draft_password, draft_is_tournament, draft_name, max_players, show_picks, draft_speed, pack_1, pack_2, pack_3) VALUES('$password', $tour_after, '$draft_name', $max_players, $show_picks, $speed, $pack1, $pack2, $pack3)");
  5. 	//join player (as seat #1, "the Creator")
  6. 	mysql_query("INSERT INTO md_draft2user(fk_draft_id, fk_user_id, seat_number) VALUES(".$draft_id.", $_SESSION[md_userid], 1)");
  7. 	//ett welcome-chat-message frŒn mdboten
  8. 	mysql_query("INSERT INTO md_chat (fk_draft_id, fk_user_id, chat_message, chat_date)
  9. 		//insert data for now
  10. 		$sealed_name = mysql_result(mysql_query("SELECT exp_shortname FROM md_exp WHERE pk_exp_id = $tourpack"),0);
  11. 		mysql_query("INSERT INTO md_draft(draft_name, max_players, draft_status, pack_1, pack_2, pack_3, draft_start, draft_is_sealed) VALUES('Sealed $sealed_name', 1, 3, '$tourpack', '$boosterpack1', '$boosterpack2', NOW(), 1)");
  12. 		$draft_id = mysql_insert_id();
  13. 		//join player
  14. 		mysql_query("INSERT INTO md_basicland (fk_user_id, fk_draft_id) VALUES ($_SESSION[md_userid], $draft_id)");
  15. 		mysql_query("INSERT INTO md_draft2user(fk_draft_id, fk_user_id) VALUES('$draft_id', $_SESSION[md_userid])");

generatepack.php in md https://github.com/beakid/md.git | 97 lines | PHP
  1. global $_REQUEST;
  2. if(!intval($exp)) $exp = mysql_result(mysql_query("SELECT pk_exp_id FROM md_exp WHERE exp_name = '".addslashes($exp)."'"),0);
  3. 	//create packrow in md_pack and generate pk_pack_id
  4. 	mysql_query($apa = "INSERT INTO md_pack(fk_draft_id, fk_exp_id, pack_number, fk_user_id, seat_number, pack_type) SELECT '$draft_id', pk_exp_id, '$pack_number', '$user_id', '$seat_number', '$pack_type' FROM md_exp WHERE pk_exp_id = '$exp'");
  5. 		//reg cards
  6. 		mysql_query("INSERT INTO md_packcard(fk_pack_id, fk_card_id) 
  7. 		
  8. 		mysql_query("INSERT INTO md_packcard(fk_pack_id, fk_card_id) SELECT '$pk_pack_id', pk_card_id FROM md_cards WHERE fk_exp_id = '$exp' AND card_rarity = 'C' AND card_color = 'B' AND card_type NOT LIKE 'Basic Land%' ORDER BY rand() LIMIT 1");
  9. 		$cq_result = mysql_query("SELECT fk_card_id FROM md_packcard WHERE pk_packcard_id = ".mysql_insert_id());
  10. 		$cq_values = mysql_fetch_array($cq_result);
  11. 		$c1 = $cq_values[fk_card_id];
  12. 		mysql_query("INSERT INTO md_packcard(fk_pack_id, fk_card_id) SELECT '$pk_pack_id', pk_card_id FROM md_cards WHERE fk_exp_id = '$exp' AND card_rarity = 'C' AND card_color = 'R' AND card_type NOT LIKE 'Basic Land%' ORDER BY rand() LIMIT 1");
  13. 		$cq_result = mysql_query("SELECT fk_card_id FROM md_packcard WHERE pk_packcard_id = ".mysql_insert_id());
  14. 		$cq_values = mysql_fetch_array($cq_result);
  15. 		$c2 = $cq_values[fk_card_id];
  16. 		mysql_query("INSERT INTO md_packcard(fk_pack_id, fk_card_id) SELECT '$pk_pack_id', pk_card_id FROM md_cards WHERE fk_exp_id = '$exp' AND card_rarity = 'C' AND card_color = 'U' AND card_type NOT LIKE 'Basic Land%' ORDER BY rand() LIMIT 1");
  17. 		$cq_result = mysql_query("SELECT fk_card_id FROM md_packcard WHERE pk_packcard_id = ".mysql_insert_id());




kortparm_functions.php in md https://github.com/beakid/md.git | 400 lines | PHP
  1. function cardid2filename($text) {
  2. 	$kort = mysql_fetch_array(mysql_query("SELECT name, exp, version FROM cards WHERE id = ".$text));
  3. 	
  4. 	$namnet = mysql_result(mysql_query("SELECT name FROM cards WHERE id = $cardid"),0);
  5. 		$text='';
  6. 		$query=mysql_query("SELECT username, medlemmar.id AS hansid, suid, SUM(antal) AS antal, MAX(expiry), foil, sign FROM medlemmar, torget_have 
  7. 		$text='';
  8. 		$query=mysql_query("SELECT username, medlemmar.id AS hansid, suid, SUM(antal) AS antal, foil, MAX(expiry), sign FROM medlemmar, torget_want
  9. 			$text='';
  10. 			$query = mysql_query($kennet = "SELECT username, medlemmar.id AS hansid, torget_have.lang_id, IF(antal > 1,ROUND(pris/antal),pris) AS pris, MAX(expiry), SUM(antal) AS antal, foil, sign, suid, cards.name FROM medlemmar, torget_have 
  11. 			$text='';
  12. 			$query = mysql_query("SELECT username, SUM(antal) AS antal, lang_id, medlemmar.id AS hansid, IF(antal > 1,ROUND(pris/antal),pris) AS pris, MAX(expiry), foil, suid, cards.name FROM medlemmar, torget_want
  13. 			<?
  14. 			$query = mysql_query("SELECT COUNT(torget_auctions_autobid.ID) AS antal_bud, cards.name AS kortnamn, torget_have.lang_id, torget_auctions.topic, IF( enddate > now( ) , IF( HOUR( timediff( enddate, now( ) ) ) >24, concat( DATEDIFF( enddate, now( ) ) , ' ".getTxt("days left")."' ) , concat( HOUR( timediff( enddate, now( ) ) ) , 'h ', minute( timediff( enddate, now( ) ) ) , '".getTxt("min left")."' ) ) , '".getTxt("overtime")."' ) AS slutdatum, torget_auctions.aID, username, medlemmar.id, currentbid, auktion, foil, sign, count(torget_auctions.aID) AS antal FROM medlemmar, torget_have, torget_auctions









Back to Top