Hi below is my script displaying all the information inside the table.
Pupose:
pupose of this php page is to display all the information on my table and have a check box at the last column that will allow the user to approved the member.
Problem:
I don't how to insert a checkbox on a loop condition.
[code=php]
<?php
# Connect to the database
$dbLink = mysql_connect(" xxx.xxx.xx.x", "xxx", "xxx")
or die("Error! Failed to connect to the MySQL server!");
mysql_select_db ("databasename" , $dbLink)
or die("Error! Failed to select a database!");
# Query for a list of all existing files
$result = mysql_query("SE LECT name, age, approved FROM table1");
# Check if it was successfull
if($result)
{
# Make sure there are some files in there
if(mysql_num_ro ws($result) == 0) {
echo "<p>There are no files in the database</p>";
}
else
{
# Print the top of a table or header
echo "<table width='100%'><t r>";
echo "<td><b>Nam e</b></td>";
echo "<td><b>Age </b></td>";
echo "<td><b>Cli ck the box to approved</b></td>";
# Print each data
while($row = mysql_fetch_ass oc($result))
{
# Print file info
echo "<tr border=10><td>" . $row['name']. "</td>";
echo "<td>". $row['age']. "</td>";
#how could I add a check box here?
echo "</tr>";
}
# Close table
echo "</table>";
}
}
else
{
echo "Error! SQL query failed:";
echo "<pre>". mysql_error($db Link) ."</pre>";
}
# Close the mysql connection
mysql_close($db Link) ;
?>[/code]
Pupose:
pupose of this php page is to display all the information on my table and have a check box at the last column that will allow the user to approved the member.
Problem:
I don't how to insert a checkbox on a loop condition.
[code=php]
<?php
# Connect to the database
$dbLink = mysql_connect(" xxx.xxx.xx.x", "xxx", "xxx")
or die("Error! Failed to connect to the MySQL server!");
mysql_select_db ("databasename" , $dbLink)
or die("Error! Failed to select a database!");
# Query for a list of all existing files
$result = mysql_query("SE LECT name, age, approved FROM table1");
# Check if it was successfull
if($result)
{
# Make sure there are some files in there
if(mysql_num_ro ws($result) == 0) {
echo "<p>There are no files in the database</p>";
}
else
{
# Print the top of a table or header
echo "<table width='100%'><t r>";
echo "<td><b>Nam e</b></td>";
echo "<td><b>Age </b></td>";
echo "<td><b>Cli ck the box to approved</b></td>";
# Print each data
while($row = mysql_fetch_ass oc($result))
{
# Print file info
echo "<tr border=10><td>" . $row['name']. "</td>";
echo "<td>". $row['age']. "</td>";
#how could I add a check box here?
echo "</tr>";
}
# Close table
echo "</table>";
}
}
else
{
echo "Error! SQL query failed:";
echo "<pre>". mysql_error($db Link) ."</pre>";
}
# Close the mysql connection
mysql_close($db Link) ;
?>[/code]
Comment