Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB