How does php determine whether to read the null value in mssql?
Source: Internet
Author: User
How does php determine whether to read the null values in mssql? Environment: linuxredhat5.4, php + freetds + mssql2005server //********************************* * ******************* $ value = iconv (& quot; how can I judge the null values in mssql read by php?
Environment: linux redhat 5.4, php + freetds + mssql 2005 server
$ Value = iconv ("GB2312", "UTF-8", $ row [iconv ("UTF-8", "GB2312", $ field)]);
Echo""; // If $ field is null in mssql 2005, the following statement is not executed
Echo $ value; // if $ field is null in mssql 2005, the following statement is not executed
Echo""// If $ field is null in mssql 2005, the following statement is not executed
//****************************
Echo"
";
// Echo "waredatememo:". $ test ["waredatemo"];
Echo"
";
Echo iconv ("GB2312", "UTF-8", $ row [iconv ("UTF-8", "GB2312", $ field)]) or die ("MSG results :". mssql_get_last_message ());
$ Field is null in mssql 2005.
When the preceding statement is used for testing, the web page only displays: "MSG results:" without any message!
Solve it !....
------ Solution --------------------
Use empty to judge the query result! Because the result is an array, you cannot directly use = ''or = 0 to judge
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service