Check out this tutorial on the MySQL website:
http://www.mysql.com/articles/mysql_intro.html
Advertising
It contains links to the basics of SQL and its syntax, as well as giving you a good
grounding in MySQL specifically.
As others have stated, most of the functionality you really need should be built into
the SQL query. It's redundant to request excessive results from the database server,
only to filter them out with custom php routines.
-----Original Message-----
From: Chris Shiflett [mailto:[EMAIL PROTECTED]]
Sent: Monday, 30 September 2002 3:30 PM
To: Justin French
Cc: Jeff Bluemel; [EMAIL PROTECTED]
Subject: Re: [PHP] syntax question
Justin French wrote:
>on 30/09/02 2:44 PM, Jeff Bluemel ([EMAIL PROTECTED]) wrote:
>
>
>>how to I test for a null value?
>>
>>
>empty()? isset()? if($var == "")? if($var == "NULL")?? have a look in
>the php manual for string functions, and comparison operators
>
I think he maybe meant testing for null values in SQL.
If this is true, there is the null keyword: "is null" and "is not null".
select * from table_name where column_name is not null
This selects all rows from a table where the data in column column_name
is not null. Be careful with this, as it actually tests for null and not
an empty string, for example. If you want to test whether a value is
null once you have assigned it to a PHP variable, you can use one of
Justin's suggestions.
In addition, PHP has null as well.
Happy hacking.
Chris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php