SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Mar 31, 2005, 20:09 #1
- Join Date
- Mar 2005
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Selecting Mulitple values from DB out put table
I can't figure out how to have each value submited, and extracted to post to MySQL...
PHP Code:while ($row = mysql_fetch_array($result, MYSQL_NUM))
{
// Alternate color schemes.
$row_color = ($row_count % 2) ? $color1 : $color2;
if($row[6]== 1)
{
$start = 'yes';
}
else {
$start = 'no';
}
echo "<tr bgcolor=\"$row_color\">
<td align=\"left\" >$row[0]</td>
<td align=\"left\" >$row[1]</td>
<td align=\"left\" >$row[2]</td>
<td align=\"left\" >$row[3]</td>
<td align=\"center\" >$row[4]</td>
<td align=\"center\" >$row[5]</td>
<td align=\"center\" >$start</td>
<td align=\"center\" ><select name=\"di\"><option value=\"\">-</option><option value=\"".$row[7]. ", 1\">start</option><option value=\"".$row[7]. ", 0\">sit</option>
";
$row_count++;
}
In the value there are 3 options(one NULL) to submit to MYsql to post a binary value I don't know where to go from here.
Thanks
-
Apr 1, 2005, 01:41 #2
- Join Date
- Feb 2005
- Location
- Chester, Cheshire
- Posts
- 565
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
is there a form tag on the page anywhere? in the code you posted i'm not seeing one... if you want that select box to alter values in a DB you'll need to post their values to another page...
PHP Code:
td align=\"center\" ><form method=\"post\" action=\"formprocessor.php\"><select name=\"di\"><option value=\"\">-</option><option value=\"".$row[7]. ", 1\">start</option><option value=\"".$row[7]. ", 0\">sit</option> </select></form>
-
Apr 1, 2005, 07:41 #3
- Join Date
- Mar 2005
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Yes of coarse there is I didn't post it. I need to know how to get the data to coincide with the row that is produced by the while function.
Bookmarks