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

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

This query:

Code:
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

Reply

Tags

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 09:17 PM.


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