The magic in header.inc.php...
Submitted by phrax on Tue, 2004-11-30 09:50.
DB Hoopla | Wonky Code
Last week we looked at PHP's limited MySQL functionality. Today we have another example for the PHP guys to improve the MySQL library. That's sarcasm for those that missed it the first time.
On a more WTF note, I wonder what's inside header.inc.php. Especially since it is included into the code like nine times! Anybody know the difference between using include()
versus require()
?
Thanks to Stefan for sending this in.
<?php
include("header.inc.php");
$resultaa = mysql_query("SELECT gameid_gewinn_slot FROM `V4_gameid_gewinn`");
$myrowaa = mysql_fetch_row($resultaa);
$gameid_gewinn_slot = $myrowaa[0];
$resultab = mysql_query("SELECT gameid_gewinn_gewinn_slot FROM `V4_gameid_gewinn`");
$myrowab = mysql_fetch_row($resultab);
$gameid_gewinn_gewinn_slot = $myrowab[0];
$resultac = mysql_query("SELECT gameid_gewinn_slot_2 FROM `V4_gameid_gewinn`");
$myrowac = mysql_fetch_row($resultac);
$gameid_gewinn_slot_2 = $myrowac[0];
$resultad = mysql_query("SELECT gameid_gewinn_gewinn_slot_2 FROM `V4_gameid_gewinn`");
$myrowad = mysql_fetch_row($resultad);
$gameid_gewinn_gewinn_slot_2 = $myrowad[0];
$resultae = mysql_query("SELECT gameid_gewinn_zockie FROM `V4_gameid_gewinn`");
$myrowae = mysql_fetch_row($resultae);
$gameid_gewinn_zockie = $myrowae[0];
$resultaf = mysql_query("SELECT gameid_gewinn_gewinn_zockie FROM `V4_gameid_gewinn`");
$myrowaf = mysql_fetch_row($resultaf);
$gameid_gewinn_gewinn_zockie = $myrowaf[0];
// ... and repeat a dozen or so times.
$gameid_o = mysql_query("SELECT id FROM `V4_jackpot_o`");
require("header.inc.php");
while ($myrowo = mysql_fetch_row($gameid_o)) {
$gameido = $myrowo[0];
};
$gameid_n = mysql_query("SELECT id FROM `V4_jackpot_n`");
require("header.inc.php");
while ($myrown = mysql_fetch_row($gameid_n)) {
$gameidn = $myrown[0];
};
$gameid_p = mysql_query("SELECT id FROM `V4_jackpot_p`");
require("header.inc.php");
while ($myrowp = mysql_fetch_row($gameid_p)) {
$gameidp = $myrowp[0];
};
$gameid_b = mysql_query("SELECT id FROM `V4_jackpot_b`");
require("header.inc.php");
while ($myrowb = mysql_fetch_row($gameid_b)) {
$gameidb = $myrowb[0];
};
$gameid_m = mysql_query("SELECT id FROM `V4_jackpot_m`");
require("header.inc.php");
while ($myrowm = mysql_fetch_row($gameid_m)) {
$gameidm = $myrowm[0];
};
$gameid_q = mysql_query("SELECT id FROM `V4_jackpot_q`");
require("header.inc.php");
while ($myrowq = mysql_fetch_row($gameid_q)) {
$gameidq = $myrowq[0];
};
$gameid_r = mysql_query("SELECT id FROM `V4_jackpot_r`");
require("header.inc.php");
while ($myrowr = mysql_fetch_row($gameid_r)) {
$gameidr = $myrowr[0];
};
$gameid_s = mysql_query("SELECT id FROM `V4_jackpot_s`");
require("header.inc.php");
while ($myrows = mysql_fetch_row($gameid_s)) {
$gameids = $myrows[0];
};
// more nice stuff inside .. but not necessary for laughing :)
?>