Hello,
I create PHP/Mysql table that consist of 6 column.I want to make the column grade as select input of A,B,C,D to the database and i want to add select input to the Add it column .I tried several way but didn't know How ?
<?php
// build SELECT query
$query = "SELECT * FROM study";
// Connect to MySQL
if ( !( $database = mysql_connect( "localhost",
"gjk", "hj" ) ) )
die( "Could not connect to database </body></html>" );
// open database
if ( !mysql_select_db( "adv", $database ) )
die( "Could not open database </body></html>" );
// query database
if ( !( $result = mysql_query( $query, $database ) ) )
{
print( "<p>Could not execute query!</p>" );
die( mysql_error() . "</body></html>" );
} // end if
mysql_close( $database );
?><!-- end PHP script -->
<table>
<caption>Results of "SELECT <?php print( "$select" ) ?>
"</caption>
<tr>
<th> </th>
<th>Code</th>
<th>Title</th>
<th>cr</th>
<th> prerequisite</th>
<th>Addit</th>
<th>Grade</th>
<tr>
<?php
// fetch each record in result set
while ( $row = mysql_fetch_row( $result ) )
{
// build table to display results
print( "<tr>" );
foreach ( $row as $value )
print( "<td>$value</td>" );
print( "</tr>" );
} // end while
?><!-- end PHP script -->
</table>
<p>Your search yielded
<?php print( mysql_num_rows( $result ) ) ?> results.</p>
</body>
</html>