Magic quotes and data integrity 2
Posted: Fri Nov 01, 2002 7:37 am
When I submit a text-field from a form using POST. I (the client) might fill the field with data like:
Note that there letters in the data.
I use MySQL and PHP.
Let's say I want to perform a data insertion:Is there a conversion function I can use to convert the parameter to a valid number and get a type incompatibility error if it is not possible?
I refer to the ASP.VBScript function "clng()" .
clng() reports an error and aborts execution of the ASP-page.
would the PHP funtion "intval()" do the same?
I could test this on my computer and learn by myself, but I am far from the machine right now, and I believe It might be good for all of us newbies to read the anwers to this post.
Code: Select all
123blablaI use MySQL and PHP.
Let's say I want to perform a data insertion:
Code: Select all
mysql_query("insert into table1 set Var1='".convert_function({$_POSTї'Fieldname1']})."'I refer to the ASP.VBScript function "clng()" .
clng() reports an error and aborts execution of the ASP-page.
would the PHP funtion "intval()" do the same?
I could test this on my computer and learn by myself, but I am far from the machine right now, and I believe It might be good for all of us newbies to read the anwers to this post.