FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » pgsql and exception
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: pgsql and exception [message #178122 is a reply to message #178116] Mon, 14 May 2012 13:40 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 5/14/2012 8:56 AM, M. Strobel wrote:
> Am 14.05.2012 14:24, schrieb Une Bévue:
>> On 14/05/12 09:45, "Álvaro G. Vicario" wrote:
>>> This isn't a database error, it's a PHP error. The line where you define
>>> $ret's current value:
>>>
>>> $ret=$db->query($sql);
>>>
>>> ... failed. Such function should return a object but it didn't
>>> (probably, because it returned FALSE instead).
>>>
>>> «Return Values: A query result resource on success or FALSE on failure.»
>>
>> right, however the PHP error is due to an SQL one :
>> i was attempting to put a string of length> 30 in a column of type "varchar(30)".
>
> how about substr()?
>
> /Str.
>
>

No - you do NOT want to change the user's input! What if it is, for
instance, a rather long user name? Or an email address?

The input field should be limited to the amount of data allowed (30
characters, in this case). And if the data coming in are still too
long, reject it with a message to the user.

Allow the user to determine what he/she wants to put in the field.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic:
Next Topic: Re: reading a newline from a properties file
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 12 20:13:05 GMT 2024

Total time taken to generate the page: 0.03560 seconds