Results 1 to 3 of 3

Thread: [RESOLVED] Loop through rows in database?

Threaded View

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Resolved [RESOLVED] Loop through rows in database?

    I have seven records in my table(in one row) in a db and i need to join them together into one $var, so like, $a1.a2.a3.$4...$a7 this is ok. I must need to loop though the columns one by one and make this $var from each row,

    I can do it for the first row ok, but it just works for one row at the moment.

    if ($result=mysql_query($sql)) {

    if ($row=mysql_fetch_row($result)) {

    $ggg = $row[0].$row[1].$row[2].$row[3].$row[4].$row[5].$row[6];
    }

    }

    Something like 'do while cols are ot empty' sort of thing......

    Any ideas?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width