User Profile

Collapse

Profile Sidebar

Collapse
Reboot
Reboot
Last Activity: Jan 27 '12, 03:20 PM
Joined: Jan 12 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Reboot
    replied to How to read next row in a mySql Query
    in PHP
    The user mikosiko (http://forums.devnetwork.net) gives me the perfect solution for this problem:
    Code:
    <?php
    
      // Example
      $heading_column = '<whatever is the name of your heading column>';
      $last_heading = null;
     
      while($row = your_fetch_assoc_statement){
            // detect a change in the heading value and output the new heading
            if($last_heading != $row[$heading_column]){
    ...
    See more | Go to post

    Leave a comment:


  • Reboot
    started a topic How to read next row in a mySql Query
    in PHP

    How to read next row in a mySql Query

    Hi!

    I have this php code which looks like this:
    Code:
    $sql = ......
    $result = mysql_query($sql,$connection)
    or die("Couldn't execute SELECT query");
     
    while ($row = mysql_fetch_array($result)) {
    ......
    }
    What i want to do is be able to read the next row in the query. So for example:
    Code:
    while ($row = mysql_fetch_array($result)) {
    ......
    ...
    See more | Go to post
No activity results to display
Show More
Working...