Jump to content

check box, array, table woes


jama

Recommended Posts

Hi

 

One quick little issue. I want to display a table for all the activities that are in a table, with a check box in another column stored in an array with the name of that activity.

 

I think this is the right way to approach it but have screwed up with the "" '' .. within the table.

 

Could someone take a 2 second look and see what they think.

 

<?php
require("includes/sesh.inc");
require("includes/header.inc");
require("includes/db.inc");
require("includes/menu.inc");

$currentuser = $_SESSION['uid'];

echo "<h1>Select Activities you wish to partake in</h1>";

//display full list of people in the database with option to edit or delete
$query = "SELECT * FROM activities";
$result = mysql_query($query);

echo "<form action='useractivities.php?submit=yes' method='post'>";
echo "<p><table border='1'><tr><th>Activity</th><th>Opt In</th></tr>";

while ($row = mysql_fetch_array($result))
{
extract($row);
echo "<tr><td>".ucwords(strtolower($activitytitle))."</td><td>" ."input type="checkbox" name="acts[]" value="$activitytitle"". "<td></tr>";
}

echo "</table>";

echo "<input type='submit' value='time'>";
echo "</form>"; 

require("includes/footer.inc");
?>


 

Jama

Link to comment
https://forums.phpfreaks.com/topic/201408-check-box-array-table-woes/
Share on other sites

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.