<?php
include("../con.php");
include("../fu.php");
connectdb();
$time=time();
$a = rand(1, 6);
$b = rand(1, 6);
$c = rand(1, 6);
mysql_query("insert into numtao_lotto values('','$a','$b','$c','$time')");
$result=mysql_fetch_array(mysql_query("select id,number_1,number_2,number_3 from numtao_lotto order by id DESC LIMIT 1"));
$roww=$result[0];
$sql = "SELECT * FROM numtao WHERE rid='$roww' ORDER BY timesent DESC LIMIT 150";
$items = mysql_query($sql);
echo mysql_error();
if(mysql_num_rows($items)>0)
{
while ($item = mysql_fetch_array($items))
{
$aa = $result[1];
$bb = $result[2];
$cc = $result[3];
if ($aa == $item[2] and $bb == $item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*3;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($aa == $item[2] and $cc == $item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*3;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($bb == $item[2] and $cc == $item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*3;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($aa==$item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*2;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($bb==$item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*2;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($cc==$item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*2;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else if ($aa == $item[2] and $bb == $item[2] and $cc == $item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*5;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
else
{
mysql_query("UPDATE numtao SET give='$item[1]' WHERE rid='$roww' AND uid='$item[4]'");
}
}
}
?>
else if ($aa == $item[2] and $bb == $item[2] and $cc == $item[2]) {
$gpl = $item[1];
$ugpl = $item[1]*5;
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
}
พอตรงเงื่อนไขนี้ี้อ่ะไม่ทำงาน
Quote:
แต่เงื่ยนไขตัวนี้ทำงานเเทนจะแก้ยังไงครับ
if ($aa == $item[2] and $bb == $item[2]) {
24.
$gpl = $item[1];
25.
$ugpl = $item[1]*3;
26.
mysql_query("UPDATE users437 SET plusses=plusses+$ugpl WHERE uid='".$item[4]."'");
27.
mysql_query("UPDATE numtao SET give='$ugpl',public='1' WHERE rid='$roww' AND uid='$item[4]'");
28.
}