Lampwrights Forum > Linux, Apache, MySQL, PHP > MySQL

Thread Tools
02-23-2011, 10:10 AM   #1
Jeff's Avatar
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Toggling a MySQL TinyInt Column

This query:

UPDATE table set field= 1 - field
Will toggle a tinyint (boolean) column in MySQL. Note, that field should have a default value of either 0 or 1 but not NULL.
Jeff is offline   Reply With Quote



mysql queries


other mysql

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 12:17 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.