0
Good morning, I’m having trouble solving a code here I have the following table in the database
The field "total" is the total number that the raffle has
The field "paid" are the numbers that have already been sold.
I want to show the numbers in up to 150 that is the amount of numbers that the raffle has, but I want the numbers 5,8,9 to appear in red!! that the user will not be able to click... Thinking this I created the following code!
for($i = 1; $i < 150 $i++)
{
if( in_array($i, array(1,3,4,5,6,7,8,9) ) ){
continue;
}
echo "<li><a class='desativado' href='#'><i>$i</i></a></li>";
}
The above Code works, it does not appear the numbers 1,3,4,5,6,7 etc. more when I put the value of db so:
if( in_array($i, array($dados['total']) ) ){
It does not show the other numbers, it only takes out the number '1' the rest keeps appearing. and miss they 'no' appear too!!
When I take the value of the database he knows not what happens simply he keeps showing the other numbers
I wanted it to stay that way:
Somebody can help me, I’ve been sitting on this since yesterday!
What you are doing is testing whether the number is in [150] and not in [1, 2, ... 150]. The best logic is to test if the number has already been drawn and use "else"
– CCastro
hi Castro good morning, I did not understand very well not! can explain me better?
– roxzin
Bernardo did just what I suggested.
– CCastro