• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Converting int to Mysql bit

#1
[eluser]fatman[/eluser]
Hi,

I need to convert 0,1 to MySql bit so i can save it in DB, any ideas?

Thanks.

#2
[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

#3
[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.

#4
[eluser]Abdul Malik Ikhsan[/eluser]
you can use :
Code:
$getpostint = (int) $_POST['yourpostparamname'];
Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.