Jump to content

For Help


tobeyt23

Recommended Posts

I have a list of messages and would like to have a radio used to select the one to make active, then when the user submits the db is updated to reflect the radio selected. Currently this is not happening any suggestions on how to fix this:

 

<?php
// update status settings
if ($submit == "Update Status") {
if (isset($emergencyid)) {
	for ($i = 0; $i < count($emergencyid); $i++) {
		$query = "UPDATE $tableMessage SET status=" . $status[$i]) . " WHERE emergencyid=" . $emergencyid[$i];
		$res = mysql_query($query);
		if (mysql_error()) {
			doStop("Message Status Failed", $query);
		}
	}
}
}
?>
<tr bgcolor="#1b3d6a">
<td valign="top" align="center" bgcolor="#ffffff"><input type="hidden" name="emergencyid[]" value="3"><label for="status[]"></label><input type="radio" name="status[]" id="status[]" value="1" checked class="admin"></td>
<td valign="top" bgcolor="#ffffff">Test</td>
<td valign="top" bgcolor="#ffffff">09-04-2007</td>
</tr>
<tr bgcolor="#1b3d6a">
<td valign="top" align="center" bgcolor="#f5f5f5"><input type="hidden" name="emergencyid[]" value="1"><label for="status[]"></label><input type="radio" name="status[]" id="status[]" value="1" class="admin"></td>
<td valign="top" bgcolor="#f5f5f5">A Breaking News Message can go here, or not, at the admin's preference.</td>
<td valign="top" bgcolor="#f5f5f5">08-14-2007</td>


</tr>

Link to comment
https://forums.phpfreaks.com/topic/67933-for-help/
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.