0
  DATE        ads visible
  2014-06-23   3    1
  2014-06-13   1    1
  2014-06-12   4    1
  2014-06-10   1    1
  2014-06-09   7    1
  2014-06-08   12   0
  2014-06-07   12   1

i have these three colums selected in mysql

through php i want to display the result like above on front end how can loop through all these columns after this check

if (!empty($adsList['ads']) and $adsList['visible']==1)
// display data here

Edited by junaid_5

2
Contributors
3
Replies
9
Views
3 Years
Discussion Span
Last Post by junaid_5
1

Just a question, why not filter the results when you do your query with a where statement "select date, ads, visible from table where visible = 1".

Secondly, how are you fetching the data to your PHP ?, most common way to get your results out would be :

$result = $mysqli->query($query)

//start a table here

$icount  = 0;
while ($record = $result->fetch_object()) {
     //make the table row

     if ($record->visible == 1 && $record->ads != 0) {
       echo " $icount {$record->DATE} {$record->ads} {$record->visible} ";   
     }
     //close the table row
     $icount++;

}

//end table here
0

please can you convert this code in simple php i want to edit but dont understand this arrow language :p .

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.