When I enter the username 700lbGorilla if goes to the "6-20 character statement" statement. Not understanding why, becase I've tested the preg_match statement before and it worked. Now that I have it in a different if statement it isn't working.

Oh... thank you, didn't know I needed those ones. Another quick question has nothing to do with this topic. If you insert something into a DB that doesn't have a value, is it like inserting nothing?

NancyJ

09-23-2005, 08:33 PM

that depends how you insert it, if you insert

as $emptyvariable then I think it would count as NULL whereas '$emptyvariable' would be a zero length string I believe.

missing-score

09-24-2005, 01:01 AM

It depends as well on your database setup. If your table is set up, and the column has "NOT NULL" set, the empty value (whether it be NULL or an empty string ""), will be inserted into the database as an empty string. If the column is set to NULL, then it will depend on your query.

A query to insert a NULL value:

INSERT INTO table VALUES ( 'value 1', NULL )

So if you are inserting an empty string with quotes around it, I think it will still count as as being a value and just insert the empty string (even the column is a NULL column)

By the way, if you are wondering, NULL columns have a use when it comes to counting. So say the field "value" in my table has some null entries, if I run

SELECT COUNT(value) FROM table

It will only return a count of the non-null entries, null entries are ignored in this case.