v5:reference:connection:getone
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
reference:getone [2015/07/13 02:21] – mnewnham | v5:reference:connection:getone [2016/01/16 23:50] – ↷ Page moved from v5:reference:getone to v5:reference:connection:getone mnewnham | ||
---|---|---|---|
Line 10: | Line 10: | ||
</ | </ | ||
+ | Executes the SQL and returns the first column of the first row. The recordset and remaining rows are discarded for you automatically. If an error occurs, either false or null is returned depending on the value of [[v5: | ||
- | Executes the SQL and returns the first field of the first row. The recordset and remaining rows are discarded for you automatically. If an error occur either false or null is returned depending on the value of $ADODB_GETONE_EOF. | + | You can use [[v5: |
===== Controlling the response if no records are found ===== | ===== Controlling the response if no records are found ===== | ||
- | By default, getOne returns NULL if no records are found. The global variable $ADODB_GETONE_EOF can be set to any value to indicate no match | + | By default, getOne returns NULL if no records are found. The global variable |
===== Usage ===== | ===== Usage ===== | ||
Line 29: | Line 30: | ||
print "No tickets have been sold in zip code 80111"; | print "No tickets have been sold in zip code 80111"; | ||
else | else | ||
- | print "The maximum number of tickets sold by arenas in Zip Code 80111 is $maxTickets"; | + | print "The maximum number of tickets sold by arenas |
+ | in Zip Code 80111 is $maxTickets"; | ||
</ | </ | ||
v5/reference/connection/getone.txt · Last modified: 2021/03/11 20:15 by dregad