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

how to read and write into a word document using php...?
hi,
I need,reading and writting into a word document using php.




Thank u inadva

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

Mail Form receiving emails with no content
Hi, I hope someone here can help me.
I have a simple form in my website, it was working OK, after

mysql select query problem
how can i select multiple fields from multiple table in one query like

i have table name t1 a

NOOB needs help with upload file
The intent of this form is to create a folder for a client and upload an image into another folder '

imap: how to save a copy of sent emails to sent elements
Hello my friends,

I am writing an online emailing application with inbox outbox/sent elements

Access database inside of a validation class
Hello,

For quite some time, I have been using functions to validate form input and access the

uploading video files into mysql in php
hi,
I have the video files which i have to upload into mysql db. along with creating thumbnails f

Merger of 6 sister companies under one flagship company after go live
Dear Experts,
I need one help regarding Merger of sister companies of same group. currently we

ALV sum various columns problem
Hi all,
I'm doing a report on ABAP for a timesheet of the current month. The output i want is s

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