i insert info in to database using mysql query. info gets added to database andi can also view itafter da is updated. my problem is i want to check whether mysql_query($query); executes and if it executes it will tell user that dat a is saved and if this query fails to work user should get autoreply. code currently written is as follows but not working and it is giving error.
if (mysql_query($query))
{
echo "Your information has been saved in.";
}
else
{
echo "Your information could not be saved in database because of some error.";
}
pl advice
nilesh
PHP-MySQL query error
Moderator: General Moderators
Re: PHP-MySQL query error
given informations are not enough to give a solution. evan you havn't gave the error code. give the all relevent code include sql statement.
-
nileshkulkarni
- Forum Newbie
- Posts: 11
- Joined: Tue Jan 22, 2008 5:29 am
Re: PHP-MySQL query error
i found the mistake. i was closing database and then executing
if{}else{} statement.
nilesh
if{}else{} statement.
nilesh