Converting int to Mysql bit - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Converting int to Mysql bit (/showthread.php?tid=36353) |
Converting int to Mysql bit - El Forum - 11-29-2010 [eluser]fatman[/eluser] Hi, I need to convert 0,1 to MySql bit so i can save it in DB, any ideas? Thanks. Converting int to Mysql bit - El Forum - 11-29-2010 [eluser]InsiteFX[/eluser] MySQL data type bit, bit will pad 0 to the left. or MySQL tinyint(1) Or are you looking for how to code? InsiteFX Converting int to Mysql bit - El Forum - 11-29-2010 [eluser]fatman[/eluser] Never mind, i got it, i just need to convert the answer from $_POST from string to int (i get '0' or '1' as string). 10x anyway. Converting int to Mysql bit - El Forum - 11-29-2010 [eluser]Abdul Malik Ikhsan[/eluser] you can use : Code: $getpostint = (int) $_POST['yourpostparamname']; |