
02-26-2007, 03:13 PM
|
|
|
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Answering my own question, from https://vborg.vbsupport.ru/showthread.php?t=75207:
Quote:
Return Values
For SELECT, SHOW, DESCRIBE or EXPLAIN statements, mysql_query() returns a resource on success, and FALSE on error.
For other type of SQL statements, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success and FALSE on error.
|
Quote:
- function query_first
Usage within vBulletin: $DB_site->query_first();
This function is a great one for saving time while coding. What is dose is query the database with $DB_site->query():, it then runs the results through $DB_site->fetch_array and returns the array based on the data in the first row retrieved by the query. It also runs $DB_site->free_result(); to save some memory.
Basically it saves you from having to write this all the time:
Code:
$query = $DB_site->query($sqltext);
$array = $DB_site->fetch_array($query);
$DB_site->free_result($query);
If simply becomes
Code:
$array = $DB_site->query_first($sqltext);
|
|