i m dealing with 2 tables.I just want to know whether there is something code that helps me fetching rows for multiple times without writing same query for that many times: Example:
while($row1=mysqli_fetch_array($result1)) {
while($row2=mysqli_fetch_array($result2)){
//checking for some condition
}
}
In above code unlike array we cant reset a variable outside the inner loop as follows
while($row1=mysqli_fetch_array($result1)) {
$number=0;//so that v can start from first row
while($row2=mysqli_fetch_array($result2)){
//checking for some condition
}
}
I m totally aware that rows and array are different,So i m asking if there is FOR loop we can use on rows?? like:
while($row1=mysqli_fetch_array($result1)) {
for(...){
//so dat it will xecute no.of whileloops*no.of for loops.
}
}
if not clear ask for more. Your suggestions are much obliged.
Edit: table: Year 1999 2000 2002 2004 2000 $result=mysqli_query($con,"select distinct Year from table_name"); dataset=mysqli_fetch_array($result)..