Jump to content

Problems with tinyint(1) (boolean) in mysql/php scripts


uebermann

Recommended Posts

Hi all,

 

PHP script I'm running resides on a Fedora 6 linux box with PHP Version 5.1.6

 

Is there a way to have a PHP script pull over boolean values (1 or 0 ) from a boolean (tinyint(1)) column from a Mysql database.  Basically I have a database in the field that is used to collect data, then the PHP script pulls the data off the remote database and inserts it into my database here at the office.  The problem with this, though, is that it sees the boolean columns in the database as "true" and "false" instead of 1s and 0s.  So when it goes to insert the data into the database here, the PHP script tries to insert "true" or "false" into a column that only accepts 1s or 0s and is stripping the data off completely (since obviously true and false are not 1 nor 0). 

 

So is there a way to keep these as 1s or 0s when transferring across or am I just going to have to change the database here int he office to accept string values of true or false on these columns instead?

 

Thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.