Regarding display of output

I use php with mysql...

I have 4 entries in a table say c1,c2,c3,c4...

I want to display them in such a way:
c1,c2
c3
c4

I dont know how to do this...

What i used to do is:


$result = mysql_query( "SELECT c1,c2,c3,c4 FROM tablename " )
or die("SELECT Error: ".mysql_error());

$num_rows = mysql_num_rows($result);

while($get_info = mysql_fetch_row($result)
{
foreach($get_info as $field)
$field
}

This displays the output in a manner: c1,c2,c3,c4....
How to get my desired output scheme...>?>?>?



Comments

  • : I use php with mysql...
    :
    : I have 4 entries in a table say c1,c2,c3,c4...
    :
    : I want to display them in such a way:
    : c1,c2
    : c3
    : c4
    :
    : I dont know how to do this...
    :
    : What i used to do is:
    :
    :
    : $result = mysql_query( "SELECT c1,c2,c3,c4 FROM tablename " )
    : or die("SELECT Error: ".mysql_error());
    :
    : $num_rows = mysql_num_rows($result);
    :
    : while($get_info = mysql_fetch_row($result)
    : {[red]
    : echo "$get_info[0],$get_info[1]
    $get_info[2]
    $get_info[3]
    ";
    : [/red]}
    :
    : This displays the output in a manner: c1,c2,c3,c4....
    : How to get my desired output scheme...>?>?>?

    Note the changes above.
  • Thanks....
    I don't know how this thing slipped from my mind...
    Yah! it worked and worked great
    Thank You very much!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories