|
-
Dec 6th, 2008, 11:50 AM
#1
Thread Starter
Frenzied Member
[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?
Last edited by Jmacp; Dec 6th, 2008 at 11:55 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|