How can I get the form below to list the single record in a db that matches
the request of $user_id?
$table = "auth_users";
$record = @mysql_query("SELECT * FROM $table WHERE user_id =
'$user_id'",$dbh);
while ($row = mysql_fetch_row($record)) {
$user_id = $row['user_id'];
$f_name = $row['f_name'];
$l_name = $row['l_name'];
$email_addy = $row['email_addy'];
$un = $row['un'];
$pw = $row['pw']; }
$var_form .= "<table width=\"100%\" border=\"0\" cellpadding=\"7\"><form
name=\"$user_id\" method=\"post\" action=\"del_account.php\">
<tr><td width=\"20%\" colspan=\"2\"><b>Edit Account
$user_id</b></td></tr>
<tr><td width=\"20%\">First Name:</td><td width=\"80%\"><input
type=\"text\" name=\"f_name\" size=\"30\" maxlength=\"30\"
value=\"$f_name\"><font class=\"copyright\">i.e. John</font></td></tr>
<tr><td width=\"20%\">Last Name:</td><td width=\"80%\"><input
type=\"text\" name=\"l_name\" size=\"30\" maxlength=\"30\"
value=\"$l_name\"><font class=\"copyright\">i.e. Doe</font></td></tr>
<tr><td width=\"20%\">Email:</td><td width=\"80%\"><input
type=\"text\" name=\"email_addy\" size=\"30\" maxlength=\"30\"
value=\"$email_addy\"><font class=\"copyright\">i.e.
[EMAIL PROTECTED]</font></td></tr>
<tr><td width=\"20%\">User Name:</td><td width=\"80%\"><input
type=\"text\" name=\"un\" size=\"30\" maxlength=\"30\" value=\"$un\"><font
class=\"copyright\">i.e. j-doe</font></td></tr>
<tr><td width=\"20%\">Password:</td><td width=\"80%\"><input
type=\"password\" name=\"pw\" size=\"30\" maxlength=\"30\"><font
class=\"copyright\">(password must be alpha-numeric, i.e.
pAs5w0rd)</font></td></tr>
<tr><td width=\"20%\">Confirm Password:</td><td
width=\"80%\"><input type=\"password\" name=\"pw\" size=\"30\"
maxlength=\"30\"><font class=\"copyright\">please confirm password
entered</font></td></tr>
<tr><td width=\"20%\"> </td><td width=\"80%\"><input
type=\"submit\" name=\"add\" value=\"edit user\"> <input
type=\"reset\" name=\"reset\" value=\"reset\"></td></tr>
</form></table>";
echo $record;
Thanks in advance,
Jas
"Natalie Leotta" <[EMAIL PROTECTED]> wrote in message
7546CB15C0A1D311BF0D0004AC4C4B0C024AC420@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024AC420@SSIMSEXCHNG...
> I could be missing something, but it looks like you are using the result
of
> the mysql_query as the actual result. It actually returns some weird
> identifier. To access the real info you'd have to use something like
> mysql_fetch_array to get it.
>
> Check out this and see if it helps:
>
> http://www.php.net/manual/en/function.mysql-query.php
>
> -Natalie
>
> -----Original Message-----
> From: Jas [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 29, 2002 12:18 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Resource ID#2 ????
>
>
> Ok here is my problem, I set this up so a user selects a name form a
select
> box and that name or $user_id is then passed to this page so the user can
> edit the contact info etc. However it does not pull the selected $user_id
> and place each field into my form boxes, all I get is a Resource ID #2.
Not
> sure how I can over come this...
>
> $table = "auth_users";
> $record = @mysql_query("SELECT * FROM $table WHERE user_id =
> '$user_id'",$dbh);
> $var_form .= "<table width=\"100%\" border=\"0\"
cellpadding=\"7\"><form
> name=\"$user_id\" method=\"post\" action=\"del_account.php\">
> <tr><td width=\"20%\" colspan=\"2\"><b>Edit Account
> $user_id</b></td></tr>
> <tr><td width=\"20%\">First Name:</td><td width=\"80%\"><input
> type=\"text\" name=\"$f_name\" size=\"30\" maxlength=\"30\"
> value=\"$f_name\"><font class=\"copyright\">i.e. John</font></td></tr>
> <tr><td width=\"20%\">Last Name:</td><td width=\"80%\"><input
> type=\"text\" name=\"$l_name\" size=\"30\" maxlength=\"30\"
> value=\"$l_name\"><font class=\"copyright\">i.e. Doe</font></td></tr>
> <tr><td width=\"20%\">Email:</td><td width=\"80%\"><input
> type=\"text\" name=\"$email_addy\" size=\"30\" maxlength=\"30\"
> value=\"$email_addy\"><font class=\"copyright\">i.e.
> [EMAIL PROTECTED]</font></td></tr>
> <tr><td width=\"20%\">User Name:</td><td width=\"80%\"><input
> type=\"text\" name=\"$un\" size=\"30\" maxlength=\"30\"
value=\"$un\"><font
> class=\"copyright\">i.e. j-doe</font></td></tr>
> <tr><td width=\"20%\">Password:</td><td width=\"80%\"><input
> type=\"password\" name=\"$pw\" size=\"30\" maxlength=\"30\"><font
> class=\"copyright\">(password must be alpha-numeric, i.e.
> pAs5w0rd)</font></td></tr>
> <tr><td width=\"20%\">Confirm Password:</td><td
> width=\"80%\"><input type=\"password\" name=\"$pw\" size=\"30\"
> maxlength=\"30\"><font class=\"copyright\">please confirm password
> entered</font></td></tr>
> <tr><td width=\"20%\"> </td><td width=\"80%\"><input
> type=\"submit\" name=\"add\" value=\"edit user\"> <input
> type=\"reset\" name=\"reset\" value=\"reset\"></td></tr>
> </form></table>";
> echo $record;
> } else {
> blah blah
> }
> Thanks in advance,
> Jas
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php