Reply to Re: Form Will Not Update MySQL DB

Your name:

Reply:


Posted by FrobinRobin on 08/14/07 09:48

On Aug 13, 1:08 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> FrobinRobin wrote:
> > yeah agree with petersprc - seems you have the input name on the form
> > as 'fullname' but you are using $_REQUEST['consumer_fullname']??
>
> > The best way to solve ur own problem (and I make these silly mistakes
> > ALL the time) is to
> > a) echo your query to the page and try it directly in your database
> > b) use print_r($any_var); (with <pre></pre> tags for formatting) to
> > see the contents of arrays (i.e. use print_r($_POST);)
>
> > Also I dont see how you are using the "$result_of_updated_file"
> > variable as the script doesnt show any conditional for it. Personally
> > I use the "mysql_affected_rows" function and a conditional:
>
> > if(mysql_affected_rows($result) > 0)
> > {
> > echo "success";
> > }
> > else
> > {
> > echo mysql_error();
> > }
>
> > Also I've just started using foreach($_POST) loop to validate the
> > whole post, as well as unset($_POST['input_name']) to remove unwanted
> > posts.. it's a really sweet way of running functions on all form
> > variables.
>
> This is not necessarily accurate. If you update a row with the same
> information that originally was in the row, MySQL will not change the
> row (no need to, is there?), and mysql_affected_rows() will return zero.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================- Hide quoted text -
>
> - Show quoted text -

Thats good to know! Thanks Jerry :)
Time to update my form validation then... lol

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация