Jump to content

How to get column data from mysql db?


vinaysnarayan

Recommended Posts

Hi

 

I have 17 fields (columns) in a mysql table. I have 6 text boxes. I want to populate the text boxes with the column data after I click the submit button.

 

What query should I use?

 

If I use the query - "select `column_name` from `table_name`", its returning empty values.

How to do this? Please correct where i'm going wrong.

 

Thanks,

Vinay

Link to comment
https://forums.phpfreaks.com/topic/154681-how-to-get-column-data-from-mysql-db/
Share on other sites

<?
$sql="SELECT column_name, column_name, column_name, column_name, column_name, column_name FROM Table_name";
$result=mysql_query($sql);

while( $rows = mysql_fetch_array($result)){
echo "". $rows['column_name'] ."";
}
?>

that should do the trick, replace column_name with your column names you are trying to call, also the table name

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.