Transferring data from one table to another

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • computerfox
    Contributor
    • Mar 2010
    • 276

    #31
    Code:
    $id="_GET['ID']";
    
    while($info = mysql_fetch_array( $data )) 
    { 
    
    Print "<tr>";
    Print "<th>ID: ".$info['ID'] . "</th> "; 
    Print "<th>Time: " .$info['Time'] . "</th>";
    Print "<th>Name: ".$info['Client'] . " </th>"; 
    Print "<th>Number: " .$info['Number'] . "</th>";
    Print "<th>Address: " .$info['Address'] . "</th>";
    Print "<th>Issue: " .$info['Issue'] . "</th>";
    Print "<th>Notes: " . $info['Notes'] . "</th>";
    Print "<th>Status: " .$info['Status'] . "</th>";
    Print "<th>Charge: $" .$info['Charge'] . "</th>";
    Print '<th><a href="https://www.1fixcomputermedic.com/update.php?ID="$id" " target="_blank">Edit</a></th>';
    Print '<th><a href="" target="_blank">Print</a></th>';
    Print "</tr>";
    
    }

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #32
      Ok. If you want the link to include the ID, you need to put the ID into the URL, in the same way you do with the lines above it. - The links should look like: http://example.com/page.php?name=value where "name" is the name of the variable you want to pass ("id" in your case) and "value" is the value of it. - Your URL is just missing the "value" part.

      Comment

      • computerfox
        Contributor
        • Mar 2010
        • 276

        #33
        is there some way i can make the value part a variable as in so that i can put it into a loop?

        Comment

        • Atli
          Recognized Expert Expert
          • Nov 2006
          • 5062

          #34
          Explain this looping a little better.
          Do you want to display multiple values on a single page, or do you want to do something like... updating one row, and be automatically sent to the next row when done?

          P.S.
          [code=php]$id="_GET['ID']";
          // Should be
          $id=$_GET['ID'];[/code]
          See Strings and Superglobals in the manual.

          Comment

          • computerfox
            Contributor
            • Mar 2010
            • 276

            #35
            this is where i print out my data, well, at least my inprogress data.

            then i have a link for the update page, which i'm having trouble with.

            after the data has been updated, i have a script where it puts it into the correct table.

            i want the link to have a variable instead of having ?id=1, instead, i want to make it something like ?ID=$id, where $id is the id of the row, which i will be updating. in other words, it should be a link to the unique update page.

            Comment

            • computerfox
              Contributor
              • Mar 2010
              • 276

              #36
              Question:

              login.php-login information

              checklogin.php:

              { retrieve cookie if possible

              else

              set cookie
              }

              update.php

              the action for the form is set to go back to checklogin.php, but it doesn't save the username and password. why would that be?

              ALSO

              i still need help making that id link compatible with my loop in the script. any help would be greatly appreciated.

              Comment

              Working...