can anyone help? I can't seem to get the single quotes to insert in a (daylog)textarea. I'm using the $daylog = mysql_real_escape_string($daylog);...am I missing something? Thanks much in advance! Fagin

3) if $go_on is a bool, (or at least will return false for false) there's no reason to ==

4) you should probably choose a method of string formatting and stick with it, instead of using four different methods of string building in one declaration. You've got some where you close the "" and add, you've got some where you don't, you've got some where you array, some where you don't... It's a confusing mess.

5) this is your most likely culprit'$member[$i]'

That's inside double quotes, and double quote escapes cannot resolve array indexes by another variable... which is part of why I think it's silly to even use double quotes in the first place in PHP for strings except when you really want to manually escape chars, or when you want single quotes without escapes.

Would probably work... though honestly, do yourself a favor, get OUT of 2003, and switch to mysqli or PDO, then you don't have to worry about nonsense like mysql_real_escape_blah_blah_blah_namespace_too_blasted_long thanks to prepared queries. PDO's ability to pass the array as the parameter and to re-use the same query would really be sweet in a case like this.

There's a reason the normal mysql_ functions should have gone the way of the dodo along with php4.

fagin
—
2011-09-28T04:39:10Z —
#7

Gosh!

Sorry y'all

There was nothing wrong with my $daylog = mysql_real_escape_string($daylog);

I just was adding it to the wrong table!

Too many tables on one page and not enough coffee!

Thanks everyone for your help.

JeffWalden
—
2011-09-28T04:42:39Z —
#8

For debugging purposes you may want to start echoing the MySQL error information if the query fails. If you were doing that, you would have noticed exactly what the problem was and saved yourself a whole lot of time.

My bad, I missed the Logical Operators section -- though reading over the explanation of what makes them different from the Bitwise operators... they don't seem particularly logical; well, unless you're used to reverse polish notation.

Ouch... no wonder I've NEVER seen them used in PHP code despite working in PHP for six to eight years.

StarLion
—
2011-09-28T12:41:02Z —
#11

Yeah, this comes from the premise that = has a higher precedence than 'or' or 'and'.thus, $f = false or true; is interpreted as ($f = false) or true; and is why you see things such as$res = mysqli_query($query) or die("Query failed!");Because precedence will evaluate $res = first. (If it evaluated the 'or' first, $res could only be assigned a boolean value.)

Personally, I always stick to && and ||. (Which have higher precedence than =)