corkg Posted August 26, 2007 Share Posted August 26, 2007 I have some code so when you type a number in it saves it but if you want to put the value back to 0 it will not work, Thanks Link to comment https://forums.phpfreaks.com/topic/66789-not-inputting-0-to-database/ Share on other sites More sharing options...
pocobueno1388 Posted August 26, 2007 Share Posted August 26, 2007 We can't really help you unless you show us the code... Link to comment https://forums.phpfreaks.com/topic/66789-not-inputting-0-to-database/#findComment-334664 Share on other sites More sharing options...
corkg Posted August 26, 2007 Author Share Posted August 26, 2007 $ds_amount=intval(strip_tags($_POST['ds'])); elseif ($new_explosives7 <= 5){ $ds = $ds_amount; $ds = "$explosives[0]-$explosives[1]-$explosives[2]-$explosives[3]-$explosives[4]-$explosives[5]-$ds-$explosives[7]"; mysql_query("UPDATE oc SET explosives='$ds' WHERE id='$oc->id'"); Link to comment https://forums.phpfreaks.com/topic/66789-not-inputting-0-to-database/#findComment-334669 Share on other sites More sharing options...
corkg Posted August 27, 2007 Author Share Posted August 27, 2007 Is it thinking 0 is NULL Link to comment https://forums.phpfreaks.com/topic/66789-not-inputting-0-to-database/#findComment-335614 Share on other sites More sharing options...
Jessica Posted August 27, 2007 Share Posted August 27, 2007 $ds = "$explosives[0]-$explosives[1]-$explosives[2]-$explosives[3]-$explosives[4]-$explosives[5]-$ds-$explosives[7]"; That will make a string which will be something like 0-2-4-5-35-34 etc based on whatever numbers those are. Take out the quotes and it will be an integer. Link to comment https://forums.phpfreaks.com/topic/66789-not-inputting-0-to-database/#findComment-335628 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.