I'm constructing a good code to check the database and some more things, but i stopped in the line... it says:
notice: Undefined variable: getUserNew in D:\xampp\htdocs\SilverCommunity(1.6.2)\asp\class\giveaway\winner.php on line 134
My Started code:
if(isset($_POST['giftID'])) {
//select user from db.
$getUserNew = getUser_ID_($db, $id_us);
if(!empty($getUserNew)) {
//if empty, add new ticket.
newGiveaway($db, $id_us);
$hide = rand_line("../../codes.txt");
echo $hide;
}
else
{
//check dates and return
echo "Next step";
}
}
Function Code to search the user.
function getUser_ID_($db, $id_us)
{
$id_us = $_SESSION['steamid'];
global $host; $username; $password; $dbname;
$sqlu = "SELECT id_steam FROM public_giveaway WHERE id='$id_us'";
$query = mysqli_query($db, $sqlu);
while($Qrow = mysqli_fetch_array($query))
{
$getUserNew = $Qrow['id_steam'];
}
return $getUserNew;
}
maybe i'm blind... but i can't find the error.. maybe is an "', or ;"... Really... i don't know...