| fdsd | chadmaynard, only one more question, my table has the quanity as int(10) is there something better to use, because when I do not add info into quanity I want it set automaticly to null.. Should I do this with char(10)? or is there a better type? |
| action | chadmaynard wonders what 's' is |
| chadmaynard | wonders what 's' is fdsd: An int can be null |
| fdsd | chadmaynard, for some reason when I put nothing in it puts a 0 |
| chadmaynard | fdsd: you told it to! |
| fdsd | chadmaynard, really? |
| chadmaynard | fdsd: try defining it as `quantity` INT(10) DEFAULT NULL MySQL assumes a default 0 for ints |
| fdsd | show columns from repairs; shows default NULL for that |
| chadmaynard | does it say NULL yes? the NULL column? |
| fdsd | yes NULL is yes and default column is NULL |
| chadmaynard | then it should default to NULL are you inserting anything into it? are you mentioning it in the insert at all? |
| fdsd | chadmaynard, really, yeah it is being mentioned in insert I believe its using a php script |
| chadmaynard | don't mention it at all i suspect PHP is inserting the 0 if its default NULL |
| fdsd | see I do not know how to, because the user needs to have the option chadmaynard, let me upload the script |
| chadmaynard | then if they don't you need to specify NULL |
| fdsd | chadmaynard, i was trying to avoid that, also when nothing is put in with the part it puts NULL into the database chadmaynard, only with int it seems to be putting 0 |
| chadmaynard | fdsd: echo the $sql generated by PHP when a quantity is not specified |
| fdsd | chadmaynard, here are the two files, html.txt and insert.txt the html.txt is the form and the insert.txt is the php file that generates the sql statement chadmaynard, I am working on normalization now, so it wont be so messy later lol |
| chadmaynard | wow |
| fdsd | chadmaynard. what happened? |
| chadmaynard | i think my wireless and wired networks had a battle to the death twice so i disabled wireless |
| fdsd | chadmaynard, lol chadmaynard, did you get my last post? |
| chadmaynard | i never got the files |
| fdsd | chadmaynard, http://keanmarine.com/html.txt http://keanmarine.com/insert.txt |
| chadmaynard | so you aren't inserting 0 or NULL. you are inserting ''. since '' is invalid as an INT it reverts to 0 |