PHP-MySQL query error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nileshkulkarni
Forum Newbie
Posts: 11
Joined: Tue Jan 22, 2008 5:29 am

PHP-MySQL query error

Post by nileshkulkarni »

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
tili
Forum Newbie
Posts: 3
Joined: Wed Jan 23, 2008 2:27 am

Re: PHP-MySQL query error

Post by tili »

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

Post by nileshkulkarni »

i found the mistake. i was closing database and then executing
if{}else{} statement.

nilesh
Post Reply