Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.