Re: Re: delete message function

From: Date: Tue, 14 Jun 2011 12:07:38 +0000
Subject: Re: Re: delete message function
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-47855@lists.php.net to get a copy of this message
On Tue, 14 Jun 2011 00:50:39 -0500 Chris Stinemetz <chrisstinemetz@gmail.com> wrote: > On Tue, Jun 14, 2011 at 12:31 AM, Chris Stinemetz > <chrisstinemetz@gmail.com> wrote: > > I created the below delete function, but it doesn't seem to be working > > correctly. When I enter the correct password it get my echo "Incorrect > > Password Did not Delete!" When I leave the password blank the message > > will delete from mysql table. > > > > Am I missing something?? > > $result = mysql_query("SELECT Title, Password FROM mbmsgs WHERE ID > = {$_REQUEST['Msg']};"); > extract(mysql_fetch_array($result), EXTR_PREFIX_ALL, 'msg'); > > if (isset($_POST['Password'])) { > if (sha1($_POST['Password']) != $msg_Password) { > echo "Incorrect password did not delete!"; > exit; > } It sounds like the password is not set in the database. What do you get if you dump the result of your first query? Also, you should avoid extract, it litters your code with dead and untraceable variables. Use $array['msg_Passowrd'] instead. -- Simcha Younger <simcha.younger@gmail.com>

« previous php.db (#47855) next »