Jump to content
New Reality: Ads For Members ×

Fetch columns of the mysql database table into a selectbox


heartsblack

Recommended Posts

So what? I want to win the lottery.

 

Why don't you stop posting your "wish list" and try asking a question, preferably with some detail and current code.

 

You have a very similar post here http://forums.phpfreaks.com/topic/298261-transfer-data-from-one-select-box-to-another/

try

$sql = "SHOW COLUMNS FROM tablename";
$res = $mysqli->query($sql);

echo "<select name='column_names'>";

while ($row = $res->fetch_row()) {
    echo "<option>{$row[0]}</option>";
}

echo "</select>\n";

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.