RE: mysql data truncation does not cause an error to be thrown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I agree.  And maybe there is an error reporting level that can be set in mysql.

But you should also start sanitizing user input.  And do it on the server side (even if you do some on the client side).
Maybe your form's action script could be sent to directly and your javascript validation sidestepped.

> Date: Thu, 8 Nov 2007 15:50:38 +0000
> From: a.blake@xxxxxxxxxxxxx
> To: instructicc@xxxxxxxxxxx
> CC: php-db@xxxxxxxxxxxxx
> Subject: Re:  mysql data truncation does not cause an error to be thrown
> 
> Hiya
> I could check the length of the field against the entry data and 
> javascript myself out of trouble but i was more worried that there is no 
> error or message when mysql clearly returns one saying i've truncated 
> this yet php ignores it completely. It should fail or know about the 
> truncation at least !
> Cheers for your reply though :-)
> 
> Andy
> 
> Instruct ICC wrote:
> >> Using mysql_query if i try to force more data than a field can have the 
> >> data is truncated yet no error is throw at all.
> >> Is there a way round this ?
> >> Cheers
> >>
> >> Andy
> >>     
> >
> > This isn't exactly what you want to hear, but how about validating your input before submitting a query?
> >
> > _________________________________________________________________
> > Boo! Scare away worms, viruses and so much more! Try Windows Live OneCare!
> > http://onecare.live.com/standard/en-us/purchase/trial.aspx?s_cid=wl_hotmailnews
> >   
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

_________________________________________________________________
Help yourself to FREE treats served up daily at the Messenger Café. Stop by today.
http://www.cafemessenger.com/info/info_sweetstuff2.html?ocid=TXT_TAGLM_OctWLtagline

[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux