Hello i want to retrieve only one row from an mysqli statement.
The catch is that i use the $row=mysqli_fetch_array
in a while()
to loop the data. But i need a row to run as variable before the while begins
This is what i mean
$query=mysqli_query($db,"SELECT a_id,a_title,a_desc,a_url,a_img,a_uid,a_times FROM table WHERE status='1' ORDER BY a_id DESC ")or die(mysqli_error($db));
$x=$query->fetchColumn(6)
?> <marquee behavior="scroll" loop="<?php echo $x;?>" scrollamount="4" direction="left" width="100%" height="50px"> <?php
while($row=mysqli_fetch_array($query,MYSQLI_ASSOC))
{
echo $row['a_url'].$row['a_title']. $row['a_desc'];
}?>
i want the $x variable to run the marquee but before the while. any suggestions?