set update help
Posted: Sat Mar 06, 2004 4:29 pm
hello everybody,
i have an update script that will not pass the proper variable for me. What i want to do is have a cusotmer update thei minutes/seconds depending on their variable $email (passed from the login screen).
Right now the output i get is not including the $email variable. Am I using the Update Set Where syntax properly?
-----------------------------------------------------------------------
<?php
$db = mysql_connect("localhost", "....", ".....");
mysql_select_db("......_com_prix",$db);
if($submit){
$sql = "UPDATE entrants SET minutes=$minutes,seconds=$seconds WHERE email=$email";
$result = mysql_query($sql);
header ("Location: http://www......com/change/edit_verify.php?email=".$email. "");
} else{
$query="SELECT * FROM entrants where email='$email' ";
$result=mysql_query($query);
$myrow=mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First: <?php echo $myrow["first_name"]?> <?php echo $myrow["last_name"]?><br>
Email:
<?php echo $email ?><br>
Minutes: <select name="minutes"><br>
<OPTION VALUE="<?php echo $myrow["minutes"]?>"><?php echo $myrow["minutes"]?>
<OPTION VALUE="00">00
<OPTION VALUE="01">01
<OPTION VALUE="02">02
<OPTION VALUE="59">59
</SELECT>
 Seconds: <select name="seconds"><br>
<OPTION VALUE="<?php echo $myrow["seconds"]?>"><?php echo $myrow["seconds"]?>
<OPTION VALUE="00">00
<OPTION VALUE="01">01
<OPTION VALUE="05">05
<OPTION VALUE="58">58
<OPTION VALUE="59">59</SELECT><br>
<input type="Submit" name="submit" value="Update Information">
</form>
<?php
}
?>
-------------------------------------------------
any help would be great?
-Michael
i have an update script that will not pass the proper variable for me. What i want to do is have a cusotmer update thei minutes/seconds depending on their variable $email (passed from the login screen).
Right now the output i get is not including the $email variable. Am I using the Update Set Where syntax properly?
-----------------------------------------------------------------------
<?php
$db = mysql_connect("localhost", "....", ".....");
mysql_select_db("......_com_prix",$db);
if($submit){
$sql = "UPDATE entrants SET minutes=$minutes,seconds=$seconds WHERE email=$email";
$result = mysql_query($sql);
header ("Location: http://www......com/change/edit_verify.php?email=".$email. "");
} else{
$query="SELECT * FROM entrants where email='$email' ";
$result=mysql_query($query);
$myrow=mysql_fetch_array($result);
?>
<form method="post" action="<?php echo $PHP_SELF?>">
First: <?php echo $myrow["first_name"]?> <?php echo $myrow["last_name"]?><br>
Email:
<?php echo $email ?><br>
Minutes: <select name="minutes"><br>
<OPTION VALUE="<?php echo $myrow["minutes"]?>"><?php echo $myrow["minutes"]?>
<OPTION VALUE="00">00
<OPTION VALUE="01">01
<OPTION VALUE="02">02
<OPTION VALUE="59">59
</SELECT>
 Seconds: <select name="seconds"><br>
<OPTION VALUE="<?php echo $myrow["seconds"]?>"><?php echo $myrow["seconds"]?>
<OPTION VALUE="00">00
<OPTION VALUE="01">01
<OPTION VALUE="05">05
<OPTION VALUE="58">58
<OPTION VALUE="59">59</SELECT><br>
<input type="Submit" name="submit" value="Update Information">
</form>
<?php
}
?>
-------------------------------------------------
any help would be great?
-Michael