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>&nbsp;</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 Like 25 Dislike
Previous forums Next forums
Other forums

SCO Unix
I know this might not be the place to ask, but, can anyone tell me if SCO Unix comes with PHP built

error reporting
hey everyone

I have a production server in which I want error reporting but only on some page

Inserting a check in checkbox from array value
Hello all,
I have a bit of code that works for a select option box, but does not work for my chec

Reading waves
Hi,

I am trying to find a way of finding the highs and lows on a graph line, the line points

A problem with my GD class
Hello,

I created a nice (and simple for now) GD class.
The problem is , it works great on

download directory onto C drive
I am attempting (if this is possible) to write a routine to automatically dump the contents of a dir

Saas with SAP R/3
hi experts,

Is SaaS offer available in SAP? for SAP R/3? from where i can get the info a

Creating XML with php
I need to creat an XML with php and have successfully produced a valid output.
The problem I hav

progress bar...need expert opinion of experienced webmaster
Hey guys, quick question:

I want to display a progress bar when I upload files, but I am not

PHP arrays into arrays need help
Hello
I am trying to highlight the days on my calendar based on the dates that i have in my datab

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash