Do you mean, like if they are editting their profile, their existing one
shows up in the text box?

Here is a chunk of code I wrote to do that this morning:
-------------------------------------------
<?php echo("<form method='POST'
action='upload.php?school=$school&teacherusername=$teacherusername'>"); ?>

<!-- here is the part you might be looking for --!>

<textarea rows="13" name="assignment" cols="51">

<?php
        $DB_NAME = "hwnet";                                //Sets $DB_NAME
equal to "hwnet"

        $connection = mysql_connect("localhost", "youruser", "yourpass");
//Attempts to connect to the server

        $db = mysql_select_db($DB_NAME,$connection) or die("Couldn't select
database!");  //Attempts to connect to the database


        $sql = "SELECT * FROM $TABLE_NAME WHERE username =
'$teacherusername' AND password = '$password'";        // This SQL statement
calls up the table and looks for a username and password match the ones
specified

        $result = mysql_query($sql,$connection);

        while ($row = mysql_fetch_array($result)) {
                $assignment = $row['assignment'];
        echo ("Previous assignment:\n $assignment");
}

?>
</textarea>
<!-- end part your probably looking for --!>

  <input type="submit" value="Submit" name="B1"><input type="reset"
value="Reset" name="B2"></p>
</form>
-------------------------------------------

What this code did was take the existing info in the database, echo it out
to a array and then display it inside the text box.

- Kath

----- Original Message -----
From: "Anthony Rodriguez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, January 20, 2001 8:06 AM
Subject: [PHP] Pre-loading HTML form w/ mySQL data


> I've a mySQL db with user information (e.g.: name, address, phone, etc.).
>
> I'd like to pre-load an HTML form with the existing user information in
> order to enable the users to update some of the information.
>
> Are there any PHP sample scripts that I may look at to do this?
>
> Thank you!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to