Dear Friends,

I have mysql database and php script.

Script pulls all the data with their serial number in html form, from 
database however, I want each field pulled to be preceeded by a check box.

I created field in table and entered array for check boxes in php script, 
still check boxes aren't displayed.at the same time rest of the data with 
serial 
number is displayed.
------------------------------------------------------------------------------
------
Php script
------------------------------------------------------------------------------
------
<?php
// open the connection
$conn = mysql_connect("localhost", "cde_mail", "h63");

// pick the database to use 
mysql_select_db("wwwabcde_mail",$conn);

// create the SQL statement
$sql = "SELECT * FROM subscriber";

// execute the SQL statement
$result = mysql_query($sql, $conn) or die(mysql_error());

//go through each row in the result set and display data
while ($newArray = mysql_fetch_array($result)) {
    // give a name to the fields
    $id  = $newArray['id'];
    $checkbox  = $newArray['checkbox'];
    $testField = $newArray['email'];
    //echo the results onscreen
    echo "  $id $checkbox $testField <br>";
}
?>
-----------------------------------
mysql table structure
-------------------------------
     Field         Type            Attributes   Null    Default Extra    
Action   
     id             int(11)            No                auto_increment         
                    
     checkbox  char(2)         BINARY   No  []                              
     email    varchar(150)    No     
    





Reply via email to