How can I get the numbers of the lines where userid=8. I have a table with cloumns like ID and userid. So I am trying to put in php array the numbers of the lines that userid=8.
exmple:
- I have lines 1-10, and userid=8 at lines: 1,4,7,10.
- $counter[1] = 1
- $counter[2] = 4
- $counter[3] = 7
- $counter[4] = 10
I tried to use this answer: Get all mysql selected rows into an array but its didnt work.
This is how I am getting the lines where userid=8 , but how can I put them into array?
$midSelect[i]="SELECT * FROM times WHERE userid=8;
$midResult[i]=mysqli_query($con,$midSelect[i]);
while($row = mysqli_fetch_array($midResult[i])) {
$mid[i]=$row['id'];
}