Hello,
I am all to happy an confident with writing and reading from fields like varchar but I am struggling with a bit(1) mysql field. I can’t seem to change the content to either a 0 or a 1 as I guess because I am treating it like an ASCII value?
Below is my code — the bit field is called eventFull – I need to read the current value, if it is a 0 then swap it to a 1 and vice versa?
Could anyone help me?
$geteventssql2 = “SELECT * FROM `events
$geteventsresult2 = @mysql_query($geteventssql2,$connection) or die(mysql_error());
while($geteventsrow2 = mysql_fetch_array($geteventsresult2))
{
if ($geteventsrow2[‘eventFull’]==’0′) {$swap=1;}
if ($geteventsrow2[‘eventFull’]==’1′) {$swap=0;}
//print”<script>alert (‘Status has been changed’);</script>”;
//print”<script>document.location=’ticketing.php’; </script>”;
$sql = “UPDATE `events
$query = mysql_query($sql);