Modules/MTA-MySQL/mysql null: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ Returns a MySQL null type. MySQL NULL and lua nil are different concepts, and a table row can contain NULL values. In this case, you must check the value comparing it to mysql_nu...) |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ModuleFunction|MTA-MySQL}} | |||
Returns a MySQL null type. MySQL NULL and lua nil are different concepts, and a table row can contain NULL values. In this case, you must check the value comparing it to mysql_null. | Returns a MySQL null type. MySQL NULL and lua nil are different concepts, and a table row can contain NULL values. In this case, you must check the value comparing it to mysql_null. | ||
Revision as of 18:04, 14 January 2008
This function is provided by the external module MTA-MySQL. You must install this module to use this function. | |
Returns a MySQL null type. MySQL NULL and lua nil are different concepts, and a table row can contain NULL values. In this case, you must check the value comparing it to mysql_null.
Syntax
MySQLNullValue mysql_null ( )
Returns
A MySQL NULL type.
Example
Example 1: This example checks if the name of an account is null.
local result = mysql_query(handler, "SELECT name FROM account WHERE id='1' LIMIT 1") -- Execute the query if (mysql_result(result, 1, 1) == mysql_null()) then outputDebugString("The name of the account #1 is null") end mysql_free_result(result) -- Free the result