Jump to content

techboy992

Members
  • Posts

    14
  • Joined

  • Last visited

techboy992's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi The only other solution I can think of is to turn the table into "varchar" and use a unique text like "none" to replace "0". You could direct set it to 0 in the database using the default option and choose as defined =0 if it's a empty value it will set it to 0
  2. Thanks benanamen And barand and phycho I now have it working Regards Brian
  3. Hi Barand and Psycho I have problem with that load file to get it right I have try this but it is not inserting anything in the database: $sql = "LOAD DATA INFILE 'result.csv' INTO TABLE playernames FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' (playername,location,winnings,mostcash)"; // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); }; $result = mysqli_query($con, $sql); if (mysqli_affected_rows($con) == 1) { $message = "The data was successfully added!"; } else { $message = "The user update failed: "; $message .= mysqli_error($con); };
  4. Hi Barand I did check it and find it working. https://www.kingsonlinebingo.com/test/csvcreator Regards Brian
  5. Hi Barand I now have the solution to remove the '$' in the records: foreach ($arr as $record) { $record = str_replace('$','',$record); $record = str_replace(' ','',$record); $rec = array_map('trim', $record); fputcsv($fp,$rec); } so how can I now insert the records into the database using mySQLI ? Thanks in advance Brian
  6. Hi there I have a bunch of json data from a old database backup that I would like to get in to a comma delimited file for mySQL insert. Try to see attached file: What I wan to archive is to get a script that can convert the data in to a sql file that I can be executed by PHP to insert it to a mysql Database Hop some one can help me Thanks in advance result.txt
  7. I have also been working a little to try figure out how to do this I found array_intersect(array1,array2); The run: $result=array_intersect($numbers,$fullcard); print_r($result); result was Array ( [5] => 6 [6] => 7 [29] => 30 [44] => 45 [47] => 48 [72] => 75 ). which is actilly the numbers in first row on the plate and the numbers that was drawn, but now I am stuck again to actilly check and be able to show a bingo button in buttom of the card
  8. Hi there I have a bounch of if and elseif But I can not get my wished result <?php require_once("dbase.php"); $gameid=$_GET["gameid"]; $cardid=$_GET["cardid"]; $result=mysqli_query($conn, "SELECT * from games where gameid='".$gameid."'"); while($row=mysqli_fetch_array($result)){ $n1=$row["n1"]; $n2=$row["n2"]; $n3=$row["n3"]; $n4=$row["n4"]; $n5=$row["n5"]; $n6=$row["n6"]; $n7=$row["n7"]; $n8=$row["n8"]; $n9=$row["n9"]; $n10=$row["n10"]; $n11=$row["n11"]; $n12=$row["n12"]; $n13=$row["n13"]; $n14=$row["n14"]; $n15=$row["n15"]; $n16=$row["n16"]; $n17=$row["n17"]; $n18=$row["n18"]; $n19=$row["n19"]; $n20=$row["n20"]; $n21=$row["n21"]; $n22=$row["n22"]; $n23=$row["n23"]; $n24=$row["n24"]; $n25=$row["n25"]; $n26=$row["n26"]; $n27=$row["n27"]; $n28=$row["n28"]; $n29=$row["n29"]; $n30=$row["n30"]; $n31=$row["n31"]; $n32=$row["n32"]; $n33=$row["n33"]; $n34=$row["n34"]; $n35=$row["n35"]; $n36=$row["n36"]; $n37=$row["n37"]; $n38=$row["n38"]; $n39=$row["n39"]; $n40=$row["n40"]; $n41=$row["n41"]; $n42=$row["n42"]; $n43=$row["n43"]; $n44=$row["n44"]; $n45=$row["n45"]; $n46=$row["n46"]; $n47=$row["n47"]; $n48=$row["n48"]; $n49=$row["n49"]; $n50=$row["n50"]; $n51=$row["n51"]; $n52=$row["n52"]; $n53=$row["n53"]; $n54=$row["n54"]; $n55=$row["n55"]; $n56=$row["n56"]; $n57=$row["n57"]; $n58=$row["n58"]; $n59=$row["n59"]; $n60=$row["n60"]; $n61=$row["n61"]; $n62=$row["n62"]; $n63=$row["n63"]; $n64=$row["n64"]; $n65=$row["n65"]; $n66=$row["n66"]; $n67=$row["n67"]; $n68=$row["n68"]; $n69=$row["n69"]; $n70=$row["n70"]; $n71=$row["n71"]; $n72=$row["n72"]; $n73=$row["n73"]; $n74=$row["n74"]; $n75=$row["n75"]; } //echo $n75; $result=mysqli_query($conn, "SELECT * from cards where cardid='".$cardid."'"); while($row=mysqli_fetch_array($result)){ $cardis=$row["cardid"]; $nu1=$row["n1"]; $nu2=$row["n2"]; $nu3=$row["n3"]; $nu4=$row["n4"]; $nu5=$row["n5"]; $nu6=$row["n6"]; $nu7=$row["n7"]; $nu8=$row["n8"]; $nu9=$row["n9"]; $nu10=$row["n10"]; $nu11=$row["n11"]; $nu12=$row["n12"]; $nu13=$row["n13"]; $nu14=$row["n14"]; $nu15=$row["n15"]; $nu16=$row["n16"]; $nu17=$row["n17"]; $nu18=$row["n18"]; $nu19=$row["n19"]; $nu20=$row["n20"]; $nu21=$row["n21"]; $nu22=$row["n22"]; $nu23=$row["n23"]; $nu24=$row["n24"]; $nu25=$row["n25"]; } //count called numbers $result=mysqli_query($conn, "SELECT COUNT(*) AS total FROM numbers$gameid"); while($row=mysqli_fetch_array($result)) $totalcards=$row["total"]; //if($total < 30){ $result=mysqli_query($conn, "SELECT COUNT(*) AS total FROM cards where gameid='".$gameid."' AND userid='".$user_id."'"); while($row=mysqli_fetch_array($result)) $totalcards=$row["total"]; //Airplane if($n2==$nu2 AND $n3==$nu3 AND $n4==$nu4 AND $n8==$nu8 AND $n16==$nu16 AND $n18==$nu18 AND $n19==$nu19 AND $n20==$nu20 AND $n23==$nu23){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //anchor elseif($n1==$nu1 AND $n4==$nu4 AND $n6==$nu6 AND $n10==$nu10 AND $n11==$nu11 And $n12==$nu12 AND $n14==$nu14 AND $n15==$n15 AND $n16==$nu16 AND $n20==$nu20 AND $n21==$nu21 AND $n24==$nu24){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //bowtie elseif($n4==$nu4 AND $n5==$nu5 AND $n9==$nu9 AND $n10==$nu10 AND $n16==$nu16 AND $n17==$nu17 AND $n21==$nu21 AND $n22==$nu22){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //cents elseif($n7==$nu7 AND $n8==$nu8 AND $n9==$nu9 and $n11==$nu11 and $n14==$nu14 and $n15==$nu15 and $n17==$nu17 and $n19==$nu19){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //champagnebottle elseif($n8==$nu8 AND $n9==$nu9 and $n10==$nu10 and $n11==$nu11 and $n12==$nu12 and $n14==$nu14 and $n15==$nu15 and $n18==$nu18 and $n19==$nu19 and $n20==$nu20){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //champagneglassemty elseif($n1==$n1 and $n7==$nu7 and $n10==$nu10 and $n14==$nu14 and $n15==$nu15 and $n17==$nu17 and $n20==$nu20 and $n21==$nu21){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //champagneglassfull elseif($n1==$nu21 and $n6==$nu6 and $n7==$nu7 and $n10==$nu10 and $n11==$nu11 and $n12==$nu12 and $n14==$nu14 and $n15==$nu15 and $n16==$nu16 and $n17==$nu17 and $n20==$nnu20 and $n21==$nu21){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //check mark elseif($n3==$nu3 and $n4==$nu4 and $n5==$nu5 and $n9==$nu9 and $n17==$nu17 and $n21==$nu21){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //chessboard elseif($n1==$nu1 and $n3==$nu3 and $n5==$nu5 and $n7==$nu7 and $n9==$nu9 and $n11==$nu11 and $n15==$nu15 and $n17==$nu17 and $n19==$nu19 and $n21==$nu21 and $n23==$nu23 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //cornered elseif($n2==$nu2 and $n3==$nu3 and $n4==$nu4 and $n5==$nu5 and $n8==$nu8 and $n9==$nu9 and $n10==$nu10 and $n14==$nu14 and $n15==$nu15 and $n20==$nu20){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //diamond elseif($n3==$nu3 and $n7==$nu7 and $n8==$nu8 and $n9==$nu9 and $n11==$nu11 and $n12==$nu12 and $n14==$nu14 and $n15==$nu15 and $n17==$nu17 and $n18==$nu18 and $n19==$nu19 and $n23==$nu23){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //dollarsign elseif($n1==$nu1 and $n2==$nu2 and $n3==$nu3 and $n5==$nu5 and $n6==$nu6 and $n8==$nu8 and $n10==$nu10 and $n11==$nu11 and $n12==$nu12 and $n14==$nu14 and $n15==$nu15 and $n16==$nu16 and $n18==$nu18 and $n20==$nu20 and $n21==$nu21 and $n23==$nu23 and $n24==$nu24 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //doublebingo elseif($n3==$nu3 and $n6==$nu6 and $n7==$nu7 and $n8==$nu8 and $n9==$nu9 and $n10==$nu10 and $n18==$nu18 and $n23==$nu23){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //eightpack elseif($n1==$nu1 and $n2==$nu2 and $n3==$nu3 and $n4==$nu4 and $n6==$nu6 and $n7==$nu7 and $n8==$nu8 and $n9==$nu9){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //explosion elseif($n1==$nu1 and $n5==$nu5 and $n8==$nu8 and $n12==$nu12 and $n14==$nu14 and $n18==$nu18 and $n21==$nu21 and $n21==$nu21 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //fourcorners elseif($n1==$nu1 and $n5==$nu5 and $n21==$nu21 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //gobingo elseif($n16==$nu16 and $n17==$nu17 and $n18==$nu18 and $n19==$nu19 and $n20==$nu20 and $n21==$nu21 and $n22==$nu22 and $n23==$nu23 and $n24==$nu24 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //hangman elseif($n1==$nu1 and $n2==$nu2 and $n3==$nu3 and $n5==$nu5 and $n6==$nu6 and $n11==$nu11 and $n15==$nu15 and $n16==$nu16 and $n17==$nu17 and $n18==$nu18 and $n19==$nu19 and $n23==$nu23 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //happyface elseif($n4==$nu4 and $n6==$nu6 and $n10==$nu10 and $n15==$nu15 and $n16==$nu16 and $n20==$nu20 and $n24==$nu24){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //jet elseif($n3==$nu3 and $n7==$nu7 and $n10==$nu10 and $n11==$nu11 and $n12==$nu12 and $n13==$nu13 and $n14==$nu14 and $n15==$nu15 and $n17==$nu17 and $n20==$nu20 and $n23==$nu23){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } //fullcard elseif($n1==$nu1 and $n2==$nu2 and $n3==$nu3 and $n4==$nu4 and $n5==$nu5 and $n6==$nu6 and $n7==$nu7 and $n8==$nu8 and $n9==$nu9 and $n10==$nu10 and $n11==$nu11 and $n12==$nu12 and $n13==$nu13 and $n14==$nu14 and $n15==$nu15 and $n16==$nu16 and $n17==$nu17 and $n18==$nu18 and $n19==$nu19 and $n20==$nu20 and $n21==$nu21 and $n22==$nu22 and $n23==$nu23 and $n24==$nu24 and $n25==$nu25){ $link="<a href='progresive.php?cardid=$cardid&gameid=$gameid'><font color='fffff'><b>BINGO</b></font>"; } echo $link; if(!$link){ echo " <meta http-equiv='Refresh' content='0; URL=progressive.php?cardid=$cardid&gameid=$gameid' /> "; } else { echo "$link <meta http-equiv='Refresh' content='3; URL=progressive.php?cardid=$cardid&gameid=$gameid' /> "; } what I want to archive is if the numbers is fitting together then the link with bingo is showing in the end of the script.
  9. Damm was not allowed to edit my above answer twise. I really not have an idea on this one My problem is to get the emty fields in the array for the preview the 75 plates was easy to make as only needed 5 of this ARRAY: //row2 $len = 5; // total number of numbers $min = 16; // minimum $max = 30; // maximum foreach(range(0, $len - 1) as $i){ while(in_array($num = mt_rand($min, $max), $range)){} $row2[] = $num; } Which give me the result in the end http://kingswildcasino.com/bingo/select_card1.php?gameid=QlJGD7CH In the database I have a row with 27 colons where the card should be inserted, from the array and leave the blanks emty in the DB. There is 27 fields on the card but there should only be 15 numbers on it sorted as explained above. But how can get the random numbers to function and leave the emty numbers as blanks in the card ?
  10. I really not have an idea on this one My problem is to get the emty fields in the array for the preview the 75 plates was easy to make as only needed 5 of this ARRAY: //row2 $len = 5; // total number of numbers $min = 16; // minimum $max = 30; // maximum foreach(range(0, $len - 1) as $i){ while(in_array($num = mt_rand($min, $max), $range)){} $row2[] = $num; } Which give me the result in the end http://kingswildcasino.com/bingo/select_card1.php?gameid=QlJGD7CH But how can get the random numbers to function and leave the emty numbers as blanks in the card ?
  11. Hello all I have problem I can not figure out how to make a 90 ball bingo card generator I am trying to make a card like this http://www.lees-bingo.co.uk/Bingo_Ticket.jpg in exept it shall be a single card and the numbers should be placed right in the card first colon 1 -9 second colon 10 - 19 third colon 20 -29 fourh colon 30-39 fifth colon 40 - 49 sixth colon 50-59 seventh colon 60 - 69 eightth colon 70 - 79 ninth colon 80-90 there can only be 5 numbers pr row Please someone help me
  12. Problem is solved Regards Brian Olsen
  13. Hi there This string is coming from a java application, I have no option for pass the url direct as the url is generated in java and then send to my php script Could I have an example how you would do this the url is generated like this from java: https://www.exaple.com/site/acc.php?user_id=+userId+ Thanks in advance Regards Brian Olsen
  14. Hello guys I have a problem figure out how I can get value out from this string: userId ?userSessionToken=cd89584f-5711-4e0a-899a-ae9247fdcf0c I will be needing the: cd89584f-5711-4e0a-899a-ae9247fdcf0c only for my user api. Regards Brian Olsen
×
×
  • 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.