Jump to content

How to print the query ??? SEE HERE


rajmohan

Recommended Posts

Hai guys ,

this is the time to ask one question to all because i dont know who????

Actually i am having a table call TABLE_NAME in that i am having countless fields

----------------------------------------------------------------------------------------
    id      Field1        Field2      Field3      Field4    Field5      Field6 ...............................
----------------------------------------------------------------------------------------
    1      200          Empty      100        Empty    Empty      300........................
----------------------------------------------------------------------------------------

I want to print the values like this

Field1    100
Field3    100
Field6    300


Hlep Me

Link to comment
https://forums.phpfreaks.com/topic/26688-how-to-print-the-query-see-here/
Share on other sites

Try this!

[code]

$sql="select field_name, field_value from table_name where field_value!='' ";
$qry=mysql_query($sql) or die (mysql_error());
while($res=mysql_fetch_array($qry))
{
echo $res['field_name'].'          '.$res['field_value'].'<BR>';
}

[/code]


Regards,
Joshi

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.