> AB> 1. how were those queries unreadable?? and > > You're kidding, right? sorry...my bad... never had any "writing readable code" help anywhere...guess if i do it like c/c++ then it would work better
> > AB> 2. whenever i put '' around the array keys in multi dimensional arrays in a > AB> query i get a parse error of trying to use undefined keys or it doesnt > AB> expand the array all the way... and > > If you don't include '' PHP will assume you are trying to use a > constant, which (as you haven't defined one anywhere) obviously you're > not. > > $something = $my_array['area1']['blah']['value']; > > .. is the correct syntax, assuming the array is created as such. > > $something = $my_array[area1][blah][value]; > > .. will give you a Constant Undefined error warning, as it should. i keep getting confused on when i need to use a {} around the array to expand it first of all (never had to use them before). the next part of my problem was getting confused with where '' needed to go. i forgot/didnt understand that the '' around the variable/array itself was for mysql server use only and php ignores them to the point that it doesnt parse them (thought it expanded them when using the {} thing). as far as when to put '' around index names in arrays im still confused somewhat on that one: echo $array['index'];//the right way echo "$array[index]";//right way?? at least i dont get //errors echo $array"$array[\'index\']";//works on my server but //never use it > AB> 3. when i used the {} on the arrays and the '' around the keys all i got was > AB> parse error because of the '' around them... > > Try this - right before your query dump out the value of $_SESSION > with either var_dump() or print_r() - see if ALL of the values you are > trying to insert into your query are present and correct. I have a > feeling you'll find they aren't. > hmmm well i wont post my $_SESSION var dump here because it took a while just for me to read it... they are all there just the way they should (like i said above i referrenced them the wrong way)... > BTW you don't need to insert "NULL" values in MySQL, you can just not > insert anything if null is the default anyway for that field. > hmmm the way the table was set up is a timestamp(14) field called Posted and a value of some kind is required because the table was set up with: Posted timestamp(14) default not null so as far as i know of a value of some kind is required (NULL itself or some date string)... sorry for all the trouble with stuff (still dont get lots of stuff) havent done php/mysql stuff for a year yet so kind of new at it i guess... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php