#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    After pull information from the DB into table form, I have one extra cell in each row used to edit one piece of information. The problem is: if I don't put something in that perticular cell on EVERY row, it won't submit for update, unless I put something in that cell on the last row only, then submits all the rows.
    I need to be able to put something in that cell on ANY row (each row is a different persons information), hit "submit" button, and have only those rows submitted for update in DB. I need the other rows with nothing in that cell to show back up on the monitor for editing.
    Make any sense?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    36
    Rep Power
    14
    no it dosen't why are you tring to up date the whole table at once. it would help if you included the code.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Dr_E_lectric:
    no it dosen't why are you tring to up date the whole table at once. it would help if you included the code.[/quote]
    Ok Dr_E, here's the code.....
    <?php
    include('../header.inc")
    ?>
    <?php
    if ($submit) {
    if ($edit) {
    $sql2= "UPDATE active SET created_by='$created_by' WHERE created_by='xman'";
    $result = mysql_query($sql2);
    if ($result){ print "Thank You.";
    } else {print "error occured."}
    } else { print "Account not updated".;}
    } else {
    ?>
    <FORM name="f1" METHOD="POST" ACTION="<?php echo $PHP_SELF ?>">
    $result = mysql_query("select * from active where created_by='xman' ");

    <table border="1">
    <tr>
    <td>rank</td><td>fname</td><td>initial</td><td>lname</td><td>ssn</td><td>title</td><td>unit</td> <td>installation</td><td>phone</td><td>created_by</td></tr>
    <?php

    $result = mysql_query("select fname, initial, lname, ssn, title, phone from active where created_by='xman' ");
    if($row = mysql_fetch_row($result)){
    do
    {
    $fname = $row ["fname"];
    $initial = $row ["initial"];
    $lname = $row ["lname"];
    $ssn = $row ["ssn"];
    $title = $row ["title"];
    $phone = $row ["phone"];

    echo"<tr><td><input type="checkbox" name="edit"</td><td>$fname</td>
    <td>$initial</td><td>$lname</td><td>$ssn</td><td>$title</td><td>$phone</td></tr>;
    }
    while($row = mysql_fetch_array($result));}
    else { print "No records found";}
    echo"</table>";
    print("(initials and date (yyyy-mm-dd))<INPUT TYPE="TEXT" name="created_by" SIZE=15 MAXLENGTH=15");

    ?>
    <center><input type="submit" name="submit" value="Submit"></center>
    </form>
    <?php
    }
    include("../footer.inc)
    ?>
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    5
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by Dr_E_lectric:
    no it dosen't why are you tring to up date the whole table at once. it would help if you included the code.[/quote]
    Ok Dr_E, here's the code.....
    <?php
    include('../header.inc")
    ?>
    <?php
    if ($submit) {
    if ($edit) {
    $sql2= "UPDATE active SET created_by='$created_by' WHERE created_by='xman'";
    $result = mysql_query($sql2);
    if ($result){ print "Thank You.";
    } else {print "error occured."}
    } else { print "Account not updated".;}
    } else {
    ?>
    <FORM name="f1" METHOD="POST" ACTION="<?php echo $PHP_SELF ?>">
    $result = mysql_query("select * from active where created_by='xman' ");

    <table border="1">
    <tr>
    <td>rank</td><td>fname</td><td>initial</td><td>lname</td><td>ssn</td><td>title</td><td>unit</td> <td>installation</td><td>phone</td><td>created_by</td></tr>
    <?php

    $result = mysql_query("select fname, initial, lname, ssn, title, phone from active where created_by='xman' ");
    if($row = mysql_fetch_row($result)){
    do
    {
    $fname = $row ["fname"];
    $initial = $row ["initial"];
    $lname = $row ["lname"];
    $ssn = $row ["ssn"];
    $title = $row ["title"];
    $phone = $row ["phone"];

    echo"<tr><td><input type="checkbox" name="edit"</td><td>$fname</td>
    <td>$initial</td><td>$lname</td><td>$ssn</td><td>$title</td><td>$phone</td></tr>;
    }
    while($row = mysql_fetch_array($result));}
    else { print "No records found";}
    echo"</table>";
    print("(initials and date (yyyy-mm-dd))<INPUT TYPE="TEXT" name="created_by" SIZE=15 MAXLENGTH=15");

    ?>
    <center><input type="submit" name="submit" value="Submit"></center>
    </form>
    <?php
    }
    include("../footer.inc)
    ?>

Similar Threads

  1. Replies: 4
    Last Post: October 6th, 2003, 07:53 AM
  2. bypassing submit
    By elyk in forum PHP Development
    Replies: 4
    Last Post: August 5th, 2003, 01:40 AM
  3. how to submit a hidden form without a submit button?
    By yupong in forum HTML Programming
    Replies: 2
    Last Post: August 4th, 2003, 05:36 AM
  4. submit buttons and variables
    By 4dr14n in forum PHP Development
    Replies: 2
    Last Post: June 17th, 2003, 07:24 AM
  5. Just enter to submit the form..
    By anurag in forum HTML Programming
    Replies: 2
    Last Post: April 24th, 2003, 05:26 AM

IMN logo majestic logo threadwatch logo seochat tools logo