Forum Iteration
Posted: Sat Jul 22, 2006 7:26 pm
ok, ive created a simple code but its not EXACTLEY what i want, maybe someone can help me.
currently what this is doing is making a new form for each $pid in the database, thats not what i want.
I want to press the "Change The Sig" once button and it iterate the same script for all $pid's in the database, i'd say it has something to do with the placement of the loop, but im not sure where exactley where to place it.
Any help is appreciated.
Thank You.
Code: Select all
<?php
$value = "5";
$db = mysql_connect("", "", "");
mysql_select_db("bhdsig",$db);
$result = mysql_query("SELECT * FROM pid ORDER BY pid", $db)or die("Error: ".mysql_error());
while ($row = mysql_fetch_assoc($result))
{
$pid = $row['pid'];
echo "<FORM NAME='Name_01' ACTION='options.php' METHOD='POST'>
<input type='hidden' NAME='S1' VALUE='". $value ."'>
<input type='hidden' NAME='S2' VALUE='". $value ."'>
<input type='hidden' NAME='S3' VALUE='". $value ."'>
<input type='hidden' NAME='S4' VALUE='". $value ."'>
<input type='hidden' NAME='S5' VALUE='". $value ."'>
<input type='hidden' NAME='S6' VALUE='". $value ."'>
<input type='hidden' NAME='S7' VALUE='". $value ."'>
<input type='hidden' NAME='S8' VALUE='". $value ."'>
<input type='hidden' NAME='S9' VALUE='". $value ."'>
<input type='hidden' NAME='Background' VALUE='Afghanistan'>
<input type='hidden' NAME='TextColor' VALUE='Black'>
<input type='hidden' NAME='FontStyle' VALUE='Arial'>
<input type='hidden' name='oncethrough' value='Yes'>
<input type='hidden' name='playerid' value='". $pid ."'>
<input class='black' type='submit' name='submit' value='Change The Sig'>
</FORM>";
}
?>I want to press the "Change The Sig" once button and it iterate the same script for all $pid's in the database, i'd say it has something to do with the placement of the loop, but im not sure where exactley where to place it.
Any help is appreciated.
Thank You.