SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    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($resultMYSQL_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

  2. #2
    SitePoint Evangelist djdykes's Avatar
    Join Date
    Feb 2005
    Location
    Chester, Cheshire
    Posts
    566
    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> 
    you'll then need another page to handle the results...

  3. #3
    SitePoint Member
    Join Date
    Mar 2005
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •