Hi frnds,

I need display mysql field as check box value.

<?php

         mysql_connect("localhost","root","");
         mysql_select_db("postal") or die(mysql_error());


        $query = mysql_query("SELECT name FROM register");

    while ($row = mysql_fetch_assoc($query)) {

        $tag = $row['name'];

        echo "<input type='checkbox' name='register[]' [U]value='$tag'[/U] />\n";

    }

    ?>

here i paste my code here. it displayed only checkboxes. not value.any one know this send the corrections.

If I understood you correctly, this is what you want:

...
echo "<input type='checkbox' name='register[]' value='$tag' />$tag\n";
...
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.