Re: MySql Close problem
| From: | franciccio | Date: | Mon, 21 Jun 2004 21:05:38 +0000 |
| Subject: | Re: MySql Close problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-188779@lists.php.net to get a copy of this message | ||
Have you tried to specify the the handler of the connection, when you first
made the connection yo had somethig like:
$handler=mysql_connect(...);
...
...
...
mysql_close($handler);
"Erik Gjertsen" <erik@gjertsen.as> ha scritto nel messaggio
news:20040620204659.81629.qmail@pb1.pair.com...
I have problem with mysql_close
I dont understand why.
Are ther someone that have any proposal?
Thank for any help
Erik Gjertsen
Here is the code
$query = "SELECT usrid FROM users WHERE username";
$result = @mysql_query ($query); //Run the query
if (mysql_num_rows($result) == 0) { // Make the query
$query = "INSERT INTO users (username, name, email, password,
registration_date) VALUES
('$username', '$name', '$email', '$password', NOW()
)";
$result = @mysql_query ($query);
if ($result) { // IF it ran OK
// Send an email, if desired
echo '<p><b>You have been registered!</b></P>';
include("./footer.inc");
exit();
} else { // If it did not ron OK.
$message = '<p>You cout not be registered due to a system error. We
apologize for any inconvenience</p>';
}
} else {
$message = '<p>That username is alredy taken.</p>';
}
mysql_close();
} else {
$message = '<p>Please try again.</p>';
}
} // End of the main submit conditional.
// Print the error message if ther is one
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
)