Forum Moderators: coopster
<?php
$username=ass;
?>
<?php
//Database Information
$dbhost = "******";
$dbname = "****";
$dbuser = "****";
$dbpass = "****";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$result = mysql_query( "SELECT email,password FROM login1 where username='$username'"); if (!$result) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit(); }
while ( $row = mysql_fetch_array($result) )
?>
<from>
<INPUT TYPE="text" NAME="email" VALUE="<?php echo($row["email"] );?>">
<INPUT TYPE="text" NAME="email" VALUE="<?php echo($row["password"] );?>">
</form>
$result="select * from login1 where username='$username'";
$result=mysql_query($result) or die(mysql_error());
$result=mysql_fetch_array($result);<input type="text" name="email" value="<?php $result[username];?>">
<input type="text" name="email" value="<?php $result[password];?>">
Also check that the database fields actually have entries in them.
And make sure that the variable $username is set.
if ("SUBMIT" == $SUBMIT)
{ $sql = "update Login1 SET " . "password='$password', " . "email='$email' WHERE username='$username';()"; if (mysql_query($sql)) { echo("<P>Info updated.</P>"); } else { echo("<P>Error updating: " . mysql_error() . "</P>"); }}
?>
<?php
$username=ass;
?>
<?php
//Database Information
$dbhost = "localhost";
$dbname = "*******";
$dbuser = "********8";
$dbpass = "****";
//Connect to database
mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
mysql_select_db($dbname) or die(mysql_error());
$result="select * from login1 where username='$username'";
$result=mysql_query($result) or die(mysql_error());
$result=mysql_fetch_array($result);
?>
<FORM ACTION="<?php echo($PHP_SELF);?>" METHOD=POST>
<input type="text" name="password" value="<?php echo $result[password];?>">
<input type="text" name="email" value="<?php echo $result[email];?>">
<INPUT TYPE=SUBMIT NAME="SUBMIT" VALUE="SUBMIT"></FORM>
<?php
if ("SUBMIT" == $SUBMIT)
{ $sql = "update Login1 SET " . "password='$password', " . "email='$email' WHERE username='$username';()"; if (mysql_query($sql)) { echo("<P>Info updated.</P>"); } else { echo("<P>Error updating: " . mysql_error() . "</P>"); }}
?>