multiple user editing

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
oscar
Forum Commoner
Posts: 27
Joined: Wed Sep 24, 2003 7:27 pm
Location: sydney, Australia

multiple user editing

Post by oscar »

I am making a content management system and i want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of teh for loop? (cant think of the correct wording :P)t to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and allils, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head&gt;
&lt;title&gt;Conman - Edit User&lt;/title&gt;
&lt;LINK href=&quote;../templates/style.css" rel=stylesheet type=text/css>
&lt;/head&gt;
&lt;body&gt;
&lt;?
include '../config/config.php';
$x=0;
		$query = mysql_query(&quote;SELECT * from users&quote;); 

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
			mysql_close($dbh);
} else {
			echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';			
}
?&gt;

&lt;/body&gt;
&lt;/html&aml values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css&quote; rel=stylesheet type=text/css&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?
include '../config/config.php';
$x=0;
		$query = mysql_query(&quote;SELECT * from users&quote;); 

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
			mysql_close($dbh);
} else {
			echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';			
}
?&gt;

&lt;/body&gt;
&lt;/html&gt;
i cani cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&ampent management system and i want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Conman - Edit User&lt;/title&gt;
&lt;LINK href=&quote;../templates/style.css&quote; rel=stylesheet type=text/css&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?
include '../config/config.php';
$x=0;
		$query = mysql_query(&quote;SELECT * from users&quote;); 

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
			mysql_close($dbh);
} else {
			echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';			
}
?&gt;

&lt;/body&gt;
&lt;/html&gt;
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementaent management system and i want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type=&q(mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of teh for loop? (cant think of the correct wording :P)$query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is ails, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php"&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quotelayout but i cant get individual values for the id:

Code: Select all

<html>
<head&gt;
&lt;title&gt;Conman - Edit User&lt;/title&gt;
&lt;LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
&lt;?
include '../config/config.php';
$x=0;
		$query = mysql_query(&quote;SELECT * from users&quote;); 

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$data&#1111;id].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$data&#1111;accesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$data&#1111;username].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$data&#1111;password].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$data&#1111;userpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$data&#1111;email].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
			mysql_close($dbh);
} else {
			echo '&lt;center&gt;&lt;B&gt;No USERS foundlude a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'&quotp;gt;
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeinyle.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query("SELECT * from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&at system and i want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data&#p;gt;Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of teh for loop? (cant think of tylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query("SELECT * from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
mysql_close($dbh);
} else {
echo '<center><B>No USERS found</B></center>';
}
?>

</body>
</html>




i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of teh for loop? (cant think of the correct wording :P)p;quote;>';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
mysql_close($dbh);
} else {
echo '<center><B>No USERS found</B></center>';
}
?>

</body>
</html>




i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm)amp;lt;head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
&lt;?
include '../config/config.php';
$x=0;
$query = mysql_query(&quote;SELECT * from users&quote;);

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
mysql_close($dbh);
} else {
echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';
}
?&gt;

&lt;/body&gt;
&lt;/html&gt;




i cant find a good way to check teh individual id values and all p;amp;lt;/title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query("SELECT * from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
mysql_close($dbh);
} else {
echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';
}
?&a* from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it woent management system and i want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></centert;/head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i getant to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementaamp;lt;html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query("SELECT * from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
mysql_close($dbh);
} else {
echo '<center><B>No USERS found</B></center>';
}
?>

</body>
</html>




i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of teh for loop? (cant think of the correct wording :P) want to include a feature to edit user details, i have the basic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query(&quote;SELECT * from users&quote;);

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name="edituser" method="post" action="edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
ech<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query(&quote;SELECT * from users&quote;);

if (mysql_num_rows($query) &gt; 0) {
echo '&lt;form name=&quote;edituser&quote; method=&quote;post&quote; action=&quote;edituser.php&quote;&gt;';

for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
mysql_close($dbh);
} else {
echo '&lt;center&gt;&lt;B&gt;No USERS found&lt;/B&gt;&lt;/center&gt;';
}
?&gt;

&lt;/body&gt;
&lt;/html&gt;




i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it notamp;gt;
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query(&quote;SELECT * from users&quote;);

if (mysql_num_rows($query) &gt; 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quote; type=&quote;image&quote; src=&quote;../templates/gfx/submit.gif&quote; border=&quote;0&quote;&gt;';
echo' &lt;br&gt;&lt;br&gt;';
echo '&lt;/form&gt;';
mysql_close($dbh);
} else {
echo '&llates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
$query = mysql_query("SELECT * from users");

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '&lt;TABLE width=&quote;100%&quote; align=&quote;center&quote; border=&quote;1&quote;&gt;';
echo '&lt;TR&gt;&lt;TD width=&quote;5%&quote;&gt;'.$dataїid].'&lt;/td&gt;&lt;td width=&quote;5%&quote;&gt; '.$dataїaccesslvl].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;20%&quote;&gt;'.$dataїusername].'&lt;/TD&gt;&lt;TD width=&quote;15%&quote;&gt;'.$dataїpassword].'&lt;/TD&gt;';
echo '&lt;TD width=&quote;30%&quote;&gt;'.$dataїuserpic].'&lt;/TD&gt;&lt;td width=&quote;25%&quote;&gt;'.$dataїemail].'&lt;/td&gt;&lt;/TR&gt;';
echo '&lt;/Table&gt;';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '&lt;input name=&quote;id&quote; type=&quote;text&quote; value=&quote;'.$dataїid].'&quote;&gt;';

///here\/ \/ \/
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;id'.$x.'&quote;&gt;';

echo '&lt;input name=&quote;submit&quasic layout but i cant get individual values for the id:

Code: Select all

<html>
<head>
<title>Conman - Edit User</title>
<LINK href="../templates/style.css" rel=stylesheet type=text/css>
</head>
<body>
<?
include '../config/config.php';
$x=0;
		$query = mysql_query("SELECT * from users"); 

if (mysql_num_rows($query) > 0) {
echo '<form name="edituser" method="post" action="edituser.php">';

for($x = 1; $x <= mysql_num_rows($query); $x++){
$data = mysql_fetch_array($query);
echo '<TABLE width="100%" align="center" border="1">';
echo '<TR><TD width="5%">'.$data[id].'</td><td width="5%"> '.$data[accesslvl].'</TD>';
echo '<TD width="20%">'.$data[username].'</TD><TD width="15%">'.$data[password].'</TD>';
echo '<TD width="30%">'.$data[userpic].'</TD><td width="25%">'.$data[email].'</td></TR>';
echo '</Table>';
//just a test to see what the id value is(this is waht i realy want to do but it wont wrok so i tried it with the $x in there).
echo '<input name="id" type="text" value="'.$data[id].'">';

///here\/ \/ \/
echo '<input name="id'.$x.'" type="text" value="id'.$x.'">';

echo '<input name="submit" type="image" src="../templates/gfx/submit.gif" border="0">';
echo' <br><br>';
echo '</form>';
			mysql_close($dbh);
} else {
			echo '<center><B>No USERS found</B></center>';			
}
?>

</body>
</html>
i cant find a good way to check teh individual id values and all i get is the last value for $id (which is 2 atm).

Is there any way of checking for $data[id] and it not changeing on each incrementation of t
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

well assuming you're using an autoincremented field for you id and you're looping correctly (I didn't read your code that carefully), then your id should increment with each iteration of the loop.

I"m not sure what you want to do though as your question/problem wasn't explained very well.

what are you trying to do?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Well, you generate the following html:

Code: Select all

<form ....>
<input type=&quote;text&quote; name=&quote;id&quote; value=&quote;1&quote;/>
<input type=&quote;text&quote; name=&quote;id&quote; value=&quote;2&quote;/>
...
</form>
--> Solutions:

Make for each user a form
Make a checkbox so the user can choose which record he wants to edit.
oscar
Forum Commoner
Posts: 27
Joined: Wed Sep 24, 2003 7:27 pm
Location: sydney, Australia

Post by oscar »

i should have explained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouer...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;idd users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;inpupage to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried uained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';
}
?&gt;
(all inside a form of course)
but whenever i submit each link it ained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mys-*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouc66db98d8d]
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with differ

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i t
i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate aon a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i VARCHAR VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and placeblem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" valu on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';
}
?&gt;
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst valu VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyou-*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouth a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;idhe db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &am*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have triedained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&amp-----*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyoutter...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyoubetter...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quser (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value ige with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';
}
?&gt;
(all inside a form of course)
but wh-----------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkboAR VARCHAR VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).
abase

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i sub page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

ystem where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';
}
?&gt;
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyodatabase and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;&gt;';
}
?&ampd display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtil teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote;---*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different *----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouid database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyouained the problem a little better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lsou can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i triedle better...

i have a system where you can add users to a database

what i want todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

<?
for($x = 1; $x <= mysql_num_rows($query); $x++){
echo '<input name="id'.$x.'" type="text" value="'.$data[id].'">';
}
?>
(all inside a form of course)
but whenever i submit each link it returnse $x as equalling the lst value retreived

thankyou*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic | email |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 | 2 | demo | test | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*

taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to geners from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*-----------------------------*---------------*
| 01 |     2     | demo     | test     | http://site.com/img/pic.gif |email@site.com |
*----*-----------*----------*----------*-----------------------------*---------------*
taht is my table sturcture

i want to erad out that information from the database and place a link under each username that can edit it (i am trying to do it based on the id feild (by sending the id value to another page).

timvw:
how would i generate an unspecified number of forms at runtime( all with different names) i have tried using a for loop but that didnt work because as soon as i click teh edit link teh value is updated to teh last oneretreived from teh database.

this also aplies to the checkbox...i would have to generate the name using a for loop( i tried liek this)

Code: Select all

&lt;?
for($x = 1; $x &lt;= mysql_num_rows($query); $x++){
echo '&lt;input name=&quote;id'.$x.'&quote; type=&quote;text&quote; value=&quote;'.$data&#1111;id].'&quote;t todo is make a page to retreive all teh users from said database and display them on a page with a link to edit each user (link generated based on a unique id feild in the db) eg:

Code: Select all

INT    TINYINT     VARCHAR    VARCHAR          VARCHAR                 VARCHAR
*----*-----------*----------*----------*-----------------------------*---------------*
| ID | Accesslvl | Username | Password | Userpic                     | email         |
*----*-----------*----------*----------*---------
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

you could do it with different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Oing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to som're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're ng) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multipleformatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = &quote;&quote;;
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quote;&lt;a href=\&ath different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within tth different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Oove your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O;.$row['id']."\">".$row['username']."</a>";
}
echo $stuff;


how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: u're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quotthe user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo &quote;&lt;a href=\&quote;editpage.php?id=".$row['id']."\">".$row['username']."</a>&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this realll from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit aage.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only t11;'id']."\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['usernforms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Ossoc($result)){
echo "<a href=\"editpage.php?id=".$row['id']."\">&quote;.$rowї'username'].&quote;&lt;/a&gt;&quote;;
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed alonp;quote;>".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;


how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to someamp;quote;<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit naive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do thth different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experiencrname']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Odoing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within tit to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Oe doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple formswhile($row = mysql_fetch_assoc($result)){
echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt
ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitte;quote;</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id'].&quieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Orms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Ote;>".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= th different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8nd pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Oth different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row&#11, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by aeate a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you'amp;gt;".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Or and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8Oth different forms if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passer if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really du're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
[/php:1:e a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. iematino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row todoing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&q var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to g to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O111;'username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this reall"\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to bting) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'username'].&quote;&lt;/a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them byrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them formatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = &quote;&quote;;
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$r, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a&gt;&quote;;
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends onfrom the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them btrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= &quote;&lt;a href=\&quote;editpage.php?id=&quote;.$row&#1111;'id'].&quote;\&quote;&gt;&quote;.$row&#1111;'uses it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will giv>".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $e same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniquenesf=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($rs if you're doing it all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple _fetch_assoc($result)){
echo "<a href=\"editpage.php?id=".$rowї'id'].&quote;\&quote;&gt;&quote;.$rowї'username'].&quote;&lt;/a&gt;&quote;;
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a tit all from the same page, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experiencege, or if you're going to retrieve the user informatino (for editing) on another page, just use a url var and pass it to the "edit" page.

ex:

Code: Select all

while($row = mysql_fetch_assoc($result)){
   echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're look
while($row = mysql_fetch_assoc($result)){
echo "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}


that will echo the information as it's being looped. The alternaive would be to create a var above your loop then concat to it on each iteration.

ex:

Code: Select all

$stuff = "";
while($row = mysql_fetch_assoc($result)){
   $stuff .= "<a href=\"editpage.php?id=".$row['id']."\">".$row['username']."</a>";
}
echo $stuff;
how you do this really depends on how you want the user experience to be (be able to edit all users from one page, or edit one user at a time). If you're looking to do the former, then use multiple forms, and name them by appending the id of the row to some standard. ie: name="MyForm23" and name="MyForm24" etc. That will give them uniqueness and when submitted, only the elements within that specific form will be passed along.

almost forgot 8O
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

why would all the forms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))
You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.map] while ($row = mysql_f ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currentforms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))

And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))sts out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))hp]
while ($row = mysql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic ($row = mysql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php&quote;&gt;'
echo '&lt;input type=&quote;hidden&quote; name=&quote;id&quote; value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But nold generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/ ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/ ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))amp;lt;input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff anquote;/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))lly generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))uote;edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: [url]http://timvw.mad;quote;hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> mp;gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))forms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a tae'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (current;post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id;>'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't reallyamp;quote;edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programmino '<in ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))fferent name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;));/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't reallforms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/ ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;)mp;quote;post" action="edit.php&quote;&gt;'
echo '&lt;input type=&quote;hidden&quote; name=&quote;id&quote; value=&quote;' . $rowї'id'] . '&quote;/&gt;';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))forms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And thest" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of;amp;lt;form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $rowї'id'] . '&quote;/&gt;';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is]

And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unitmp;gt;';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))forms need a different name?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stg:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now yoame?

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
orm method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/pe_fetch_as ... n_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))

You could generate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But nowhod="post&quote; action=&quote;edit.php&quote;&gt;'
echo '<input type=&quote;hidden&quote; name=&quote;id&quote; value=&quote;' . $rowї'id'] . '&quote;/&gt;';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: [url]http://timvw8f3bf6]
while ($row = mysql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value=&quote;' . $rowї'id'] . '&quote;/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))111;'name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hack;'id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends))
{
echo '<form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that existsamp;quote;post" action="edit.php">'
echo '<input type=&quote;hidden&quote; name=&quote;id&quote; value=&quote;' . $rowї'id'] . '&quote;/&gt;';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))
while ($row = mysql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php&quote;&gt;'
echo '&lt;input type=&quote;hidden&quote; name=&quote;id&quote; value=&quote;' . $rowї'id'] . '&quote;/&gt;';
echo $rowї'name'];
echo '&lt;input type=&quote;submit&quote; name=&quote;edit&quote;/&gt;';
echo '&lt;/form&gt;';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: [url]http:sql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.phwing:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code igenerate the following:

Code: Select all

while ($row = mysql_fetch_assoc($rs))
{
   echo '<form method="post" action="edit.php">'
   echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>'; 
   echo $row['name'];
   echo '<input type="submit" name="edit"/>';
   echo '</form>';
}
And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here
while ($row = mysql_fetch_assoc($rs))
{
echo '<form method="post" action="edit.php">'
echo '<input type="hidden" name="id" value="' . $row['id'] . '"/>';
echo $row['name'];
echo '<input type="submit" name="edit"/>';
echo '</form>';
}


And then edit.php

Code: Select all

if (isset($_POST['edit']))
{
  $id = $POST['id'];
  ...
}

But now your code isn't really generic, because it depends on a table with a primary key that exists out of 1 column (id in this case)

So i usually provide my own row <-> id mapping.

Here is an example: http://timvw.madoka.be/demo/person_list.php
And the code i hacked together: http://timvw.madoka.be/programming/php/demo.zip (currently i'm rewriting/refactoring stuff and making unit tests ;))
oscar
Forum Commoner
Posts: 27
Joined: Wed Sep 24, 2003 7:27 pm
Location: sydney, Australia

aha

Post by oscar »

aha! that did it...thanks everyone, i ended up using timvw's last suggestion (the one form with an input) but instead of teh hidden input i used radio buttons...seemed to do teh job (just wish i'd thought of it earlier :P


thanks again everyone
Post Reply