boolean type
Does there exist a boolean column type? I checked the documentation, and it says that there exists a BOOL but it is a tinyint(1). Should I use that as a boolean? thanks in advance, prashant. query to go through filter. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Antwort: boolean type
"Thalis A. Kalfigopoulos" wrote: Is there a boolean field type (Yes/No; True/False, 1/0) in MySQL or what is closest to the boolean type ShortInt: 0 == FALSE, 0 == TRUE That's how I do it anyway. Or maybe combine multiple bool fields to one and use binary logic. Or quoting from http://www.bitbybit.dk/mysqlfaq/faq.html Q: create a column of type BOOLEAN? MySQL does not have a boolean type per se. The usual way to create a boolean value, is to use the ENUM type: mysql CREATE TABLE truths - (answer ENUM('true','false') NOT NULL); (don't forget the NOT NULL clause, or you end up having not two, but three legal values for the field.) You can also use the following hack to define a field which can contain only one of two values, namely the empty string ("") or NULL: mysql CREATE TABLE truths - (answer CHAR(0)); The special beauty of the second example is that the data in the field only occupies one bit I don't quite understand this. How is it possible to story an 1-bit value in a file or memory and use exactly only 1 bit for it? As far as I know compters can access at least 1 byte-8 bits at one time, not less. Does MySQL use a special algorithm in this case? Robert - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
boolean type
Is there a boolean field type (Yes/No; True/False, 1/0) in MySQL or what is closest to the boolean type
Antwort: boolean type
On 01.03.2001 09:50:36 Blaz Grapar wrote: Is there a boolean field type (Yes/No; True/False, 1/0) in MySQL or what is closest to the boolean type ShortInt: 0 == FALSE, 0 == TRUE That's how I do it anyway. Or maybe combine multiple bool fields to one and use binary logic. - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: boolean type
Blaz Grapar wrote: Is there a boolean field type (Yes/No; True/False, 1/0) in MySQL or what is closest to the boolean type ENUM("no","yes") - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php