mysql query not being queried
Posted: Sat Jun 19, 2010 7:30 pm
The second and third queries dont get implemented, even though the if statement is true. Can anybody see something wrong in the code?
Code: Select all
<?php
$password = crypt($_GET["pword"]);
$code = $_GET["code"];
$connection = mysql_connect("************","*********","********");
if ($connection) {
mysql_select_db("**********", $connection);
$result = mysql_query("SELECT * FROM newpassword WHERE code='$code'");//does get implemented
$accounts = mysql_num_rows($result);
if ($accounts > 0) {
$fields = mysql_fetch_row($result);
$email = $fields[1];
mysql_query("UPDATE accounts SET password='$password' WHERE email='$email'");//does not get implemented
mysql_query("DELETE * FROM newpassword WHERE code='$code'");//does not get implemented
fopen('example.txt', 'w');//does get implemented
}
}
mysql_close($connection);
?>