dynamic table with forms
Posted on
16th Feb 2014 07:03 pm by
admin
I have a table that is populated with mysql data and in teh first column there is a raido button that i would like to have it when selected and i hit either edit or delete the ID is passed to another page for the stated task. i am using raidos to prevent multiple selections. but at this time when switching selections all previous ones stay until a refresh. how can i fix this ?
Please help i am at a complete loss.....
Here is the code::
Code: (php) <?php require_once('../Connections/BIO_Clan.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_BIO_Clan, $BIO_Clan);
$query_Leaders = "SELECT clan_members.authid, clan_members.rank, clan_members.name, admins.access FROM imagest5_bioclan.clan_members LEFT OUTER JOIN imagest5_bioclan.admins ON clan_members.name = admins.name WHERE clan_members.rank = 6 ORDER BY clan_members.rank DESC, clan_members.name";
$Leaders = mysql_query($query_Leaders, $BIO_Clan) or die(mysql_error());
$row_Leaders = mysql_fetch_assoc($Leaders);
$totalRows_Leaders = mysql_num_rows($Leaders);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table width="100%" border="1" cellpadding="2" cellspacing="2">
<tr>
<td> </td>
<td>SteamID</td>
<td>Name</td>
<td>Flags</td>
</tr>
<?php do { ?>
<tr>
<td><form id="form4" name="form4" method="post" action="">
<input type="radio" name="select" id="radio" value="<?php echo $row_Leaders['authid']; ?>" />
</form></td>
<td><?php echo $row_Leaders['authid']; ?></td>
<td><?php echo $row_Leaders['name']; ?></td>
<td><?php echo $row_Leaders['access']; ?></td>
</tr>
<?php } while ($row_Leaders = mysql_fetch_assoc($Leaders)); ?>
</table>
<div align="center"><br />
<table width="62%">
<tr>
<td width="11%"><form id="form1" name="form1" method="post" action="edit.php">
<div align="center">
<input type="submit" name="edit" id="edit" value="Edit" />
</div>
</form></td>
<td width="20%"><form id="form2" name="form2" method="post" action="delete.php">
<div align="center">
<input type="submit" name="delete" id="delete" value="Delete" />
</div>
</form></td>
<td width="69%"><form id="form3" name="form3" method="post" action="">
<div align="center">
<select name="admin" id="select">
<option selected="selected">Quick Admin----</option>
<option>Ldr/CoLdr</option>
<option>Tech</option>
<option>Upper Admin</option>
<option>Mid Admin</option>
<option>Recruit Admin</option>
<option value="u">Member</option>
</select>
<input type="submit" name="admin" id="admin" value="Set" />
</div>
</form></td>
</tr>
</table>
</div>
</body>
</html>
<?php
mysql_free_result($Leaders);
?>
No comments posted yet
Your Answer:
Login to answer
324
25
Other forums
Join Query Help
Hi all,
I am having problems with the below code, which we shall call 'my first join query'!
column name cancatenation within PL/SQL
I have a PLSQL store procedure, and the following statement is part of a subquery
fname||lnam
socket communication between c++/java and sending image
hi,
i have a class in c++ called win32_sockserver which creates socket to java. i am trying
PHP - HTML
Could anyone give me some GOOD sample links for php - html email tutorial.
Thanks!
SAP FICO learning materials
Hi all,
I am new to this world of SAP FICO. I have taken training on SAP FICO, but was wonderin
formating when pulling data from a mysql database
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.
I
Product categories for registration
Dear all,
We are going live with the Supplier registered next week. At standard, the 'sel
PHP and XML image gallery variable issue
I'm trying to display the large image on the same page as the thumbnails, to do that I'm passing a v
PHP Array quick help
I need
$_SESSION{'username'} to be like this:
if $_SESSION['username'] = "gay
Detail Expenses Report by Cost Center
I would like to obtain a report out of SAP that shows a list of expenses by cost center that shows t