rajmohan Posted November 9, 2006 Share Posted November 9, 2006 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 300Hlep Me Link to comment https://forums.phpfreaks.com/topic/26688-how-to-print-the-query-see-here/ Share on other sites More sharing options...
joshi_v Posted November 9, 2006 Share Posted November 9, 2006 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 Link to comment https://forums.phpfreaks.com/topic/26688-how-to-print-the-query-see-here/#findComment-122104 Share on other sites More sharing options...
rajmohan Posted November 9, 2006 Author Share Posted November 9, 2006 whether the Field_name will bring the field name from the table??? Link to comment https://forums.phpfreaks.com/topic/26688-how-to-print-the-query-see-here/#findComment-122107 Share on other sites More sharing options...
joshi_v Posted November 13, 2006 Share Posted November 13, 2006 No..I said it an example for what you had ask. in that place you should use the actual field names in the tableCheers ;) Link to comment https://forums.phpfreaks.com/topic/26688-how-to-print-the-query-see-here/#findComment-123880 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.