Hey!!
I have this problem that looks stupidly dull, but I just can not solve it! :mad:
...This is total simplification - the real code looks different...
I have some numbers in db (one column "field" values 1,2,3,4,5 in rows).
I want a loop that checks IF THE CURRENT NUMBER $i (of the for statement) IS IN DATABASE and then print the text respectively = either number is in db or not.
<?
$getquery=mysql_query("SELECT field FROM table");
//result of this query is five numbers [1,2,3,4,5]
for($i=0; $i<50; $i++)
{
if( !!!something!!!)
{print"nuber".$i." is in database<br>";}
else
{print"nuber".$i."is NOT in db<br>";}
}
?>
There is a theorethical solution to this, to simply loop through result of the query and check for every line if it is ==$i.
But this is easy to say, impossible for me to write...
If you have any suggestions PLEASE contribute, I would appreciate very much.