$_REQUEST 0 (zero) value = null
Posted: Fri Jul 21, 2006 1:55 pm
Hi,
I'm dealing with a situation where I'm rewriting some crappy old embperl stuff in php, but keeping the UI as unmodified as possible to minimize disruption to the users. The page that I'm having problems with has a large textarea where the user can copy and paste a long list of values from Excel to update a table that joins two other tables on their primary keys.
Whoever designed the lookup tables involved was on crack or something, and there are two situations where the tables have a primary key value = 0. This value is used in a number of places (outside the scope of this application), and apparently is hard-coded in some of them... i.e. I can't just modify the key values for these two records.
As it currently stands, php is interpreting the 0 value as a null, and is failing my validation that checks for the correct number of parameters before inserting.
My question:
Is there a way for me to make this work apart from just making the page assume that a null value = 0 (since this would sort of make the validation I'm doing kind of pointless)?
Thanks,
Jason
I'm dealing with a situation where I'm rewriting some crappy old embperl stuff in php, but keeping the UI as unmodified as possible to minimize disruption to the users. The page that I'm having problems with has a large textarea where the user can copy and paste a long list of values from Excel to update a table that joins two other tables on their primary keys.
Whoever designed the lookup tables involved was on crack or something, and there are two situations where the tables have a primary key value = 0. This value is used in a number of places (outside the scope of this application), and apparently is hard-coded in some of them... i.e. I can't just modify the key values for these two records.
As it currently stands, php is interpreting the 0 value as a null, and is failing my validation that checks for the correct number of parameters before inserting.
My question:
Is there a way for me to make this work apart from just making the page assume that a null value = 0 (since this would sort of make the validation I'm doing kind of pointless)?
Thanks,
Jason