Linked Questions

1 vote
1 answer
127 views

Trying to execute insert in table with bit fields, but as result all fields are filled as 1 by default. Do not understand where my mistake or this is some specific in PDO. Example of preapred query: ...
quaresma89's user avatar
1429 votes
13 answers
1.1m views

Since MySQL doesn't seem to have any 'boolean' data type, which data type do you 'abuse' for storing true/false information in MySQL? Especially in the context of writing and reading from/to a PHP ...
user avatar
2 votes
6 answers
5k views

I have a column enabled with datatype bit(1). I am trying to save 0 or 1 value in Database by Laravel eloquent. $model->enabled = $inputs['enabled']; $model->save(); I have saved values in my ...
Faisal Khan's user avatar
7 votes
1 answer
4k views

How do I insert a BIT value in MySQL using a PDO Prepared Statement? Below is what I tried and my results. <?php function testIt($value) { $sql='INSERT INTO test(id,data) VALUES(?,?)'; $...
user1032531's user avatar
  • 26.5k
3 votes
2 answers
3k views

I'm trying to update data in a table with a BIT type value in it, like the following : // $show_contact is either '1' or '0' $query->bindValue(':scontact', $show_contact, PDO::PARAM_INT); The ...
yoda's user avatar
  • 11k
1 vote
2 answers
982 views

I have a database table with a few BIT(1) type columns. If I were to forget about prepared statements, I could easily do something like this: UPDATE tablename SET bit_column_1 = b'1', bit_column_2 = ...
Mike's user avatar
  • 24.5k
4 votes
2 answers
907 views

I experience an issue when working with PDO prepared statements and bit data types When retrieving the result from the DB with PDO prepared statement an empty result set is returnd, but the correct ...
clarkk's user avatar
  • 1
1 vote
0 answers
1k views

I have to import data from a MySQL database using phpMyAdmin. I have exported my database from my local machine using phpMyAdmin. After that I imported the script file to my host. All of data in the ...
ajeesh r's user avatar
2 votes
2 answers
427 views

I had no problems working with MySQL's BIT data type on a Windows environment with PHP and PDO. The only trick that I used was to cast it to int. But when I uploaded the code to a Linux server, then ...
Matías Cánepa's user avatar
0 votes
0 answers
236 views

I cannot insert 1 or 0 into my bit column. $executes=[1]; $prepare=$connection->prepare('insert into TABLE(BITVALUE) values(?)'); $prepare->execute($executes); Will spit out an error of: ...
Maciek's user avatar
  • 2,010