PageRenderTime 44ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/lib/php/DB/msql.php

https://bitbucket.org/adarshj/convenient_website
PHP | 810 lines | 354 code | 74 blank | 382 comment | 51 complexity | 69a8ab047481570c7b11342cd444d1c1 MD5 | raw file
Possible License(s): Apache-2.0, MPL-2.0-no-copyleft-exception, LGPL-2.1, BSD-2-Clause, GPL-2.0, LGPL-3.0
  1. <?php
  2. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  3. /**
  4. * The PEAR DB driver for PHP's msql extension
  5. * for interacting with Mini SQL databases
  6. *
  7. * PHP's mSQL extension did weird things with NULL values prior to PHP
  8. * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
  9. * those versions.
  10. *
  11. * PHP versions 4 and 5
  12. *
  13. * LICENSE: This source file is subject to version 3.0 of the PHP license
  14. * that is available through the world-wide-web at the following URI:
  15. * http://www.php.net/license/3_0.txt. If you did not receive a copy of
  16. * the PHP License and are unable to obtain it through the web, please
  17. * send a note to license@php.net so we can mail you a copy immediately.
  18. *
  19. * @category Database
  20. * @package DB
  21. * @author Daniel Convissor <danielc@php.net>
  22. * @copyright 1997-2005 The PHP Group
  23. * @license http://www.php.net/license/3_0.txt PHP License 3.0
  24. * @version CVS: $Id: msql.php,v 1.57 2005/02/22 07:26:46 danielc Exp $
  25. * @link http://pear.php.net/package/DB
  26. */
  27. /**
  28. * Obtain the DB_common class so it can be extended from
  29. */
  30. require_once 'DB/common.php';
  31. /**
  32. * The methods PEAR DB uses to interact with PHP's msql extension
  33. * for interacting with Mini SQL databases
  34. *
  35. * These methods overload the ones declared in DB_common.
  36. *
  37. * PHP's mSQL extension did weird things with NULL values prior to PHP
  38. * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
  39. * those versions.
  40. *
  41. * @category Database
  42. * @package DB
  43. * @author Daniel Convissor <danielc@php.net>
  44. * @copyright 1997-2005 The PHP Group
  45. * @license http://www.php.net/license/3_0.txt PHP License 3.0
  46. * @version Release: 1.7.6
  47. * @link http://pear.php.net/package/DB
  48. * @since Class not functional until Release 1.7.0
  49. */
  50. class DB_msql extends DB_common
  51. {
  52. // {{{ properties
  53. /**
  54. * The DB driver type (mysql, oci8, odbc, etc.)
  55. * @var string
  56. */
  57. var $phptype = 'msql';
  58. /**
  59. * The database syntax variant to be used (db2, access, etc.), if any
  60. * @var string
  61. */
  62. var $dbsyntax = 'msql';
  63. /**
  64. * The capabilities of this DB implementation
  65. *
  66. * The 'new_link' element contains the PHP version that first provided
  67. * new_link support for this DBMS. Contains false if it's unsupported.
  68. *
  69. * Meaning of the 'limit' element:
  70. * + 'emulate' = emulate with fetch row by number
  71. * + 'alter' = alter the query
  72. * + false = skip rows
  73. *
  74. * @var array
  75. */
  76. var $features = array(
  77. 'limit' => 'emulate',
  78. 'new_link' => false,
  79. 'numrows' => true,
  80. 'pconnect' => true,
  81. 'prepare' => false,
  82. 'ssl' => false,
  83. 'transactions' => false,
  84. );
  85. /**
  86. * A mapping of native error codes to DB error codes
  87. * @var array
  88. */
  89. var $errorcode_map = array(
  90. );
  91. /**
  92. * The raw database connection created by PHP
  93. * @var resource
  94. */
  95. var $connection;
  96. /**
  97. * The DSN information for connecting to a database
  98. * @var array
  99. */
  100. var $dsn = array();
  101. /**
  102. * The query result resource created by PHP
  103. *
  104. * Used to make affectedRows() work. Only contains the result for
  105. * data manipulation queries. Contains false for other queries.
  106. *
  107. * @var resource
  108. * @access private
  109. */
  110. var $_result;
  111. // }}}
  112. // {{{ constructor
  113. /**
  114. * This constructor calls <kbd>$this->DB_common()</kbd>
  115. *
  116. * @return void
  117. */
  118. function DB_msql()
  119. {
  120. $this->DB_common();
  121. }
  122. // }}}
  123. // {{{ connect()
  124. /**
  125. * Connect to the database server, log in and open the database
  126. *
  127. * Don't call this method directly. Use DB::connect() instead.
  128. *
  129. * Example of how to connect:
  130. * <code>
  131. * require_once 'DB.php';
  132. *
  133. * // $dsn = 'msql://hostname/dbname'; // use a TCP connection
  134. * $dsn = 'msql:///dbname'; // use a socket
  135. * $options = array(
  136. * 'portability' => DB_PORTABILITY_ALL,
  137. * );
  138. *
  139. * $db =& DB::connect($dsn, $options);
  140. * if (PEAR::isError($db)) {
  141. * die($db->getMessage());
  142. * }
  143. * </code>
  144. *
  145. * @param array $dsn the data source name
  146. * @param bool $persistent should the connection be persistent?
  147. *
  148. * @return int DB_OK on success. A DB_Error object on failure.
  149. */
  150. function connect($dsn, $persistent = false)
  151. {
  152. if (!PEAR::loadExtension('msql')) {
  153. return $this->raiseError(DB_ERROR_EXTENSION_NOT_FOUND);
  154. }
  155. $this->dsn = $dsn;
  156. if ($dsn['dbsyntax']) {
  157. $this->dbsyntax = $dsn['dbsyntax'];
  158. }
  159. $params = array();
  160. if ($dsn['hostspec']) {
  161. $params[] = $dsn['port']
  162. ? $dsn['hostspec'] . ',' . $dsn['port']
  163. : $dsn['hostspec'];
  164. }
  165. $connect_function = $persistent ? 'msql_pconnect' : 'msql_connect';
  166. $ini = ini_get('track_errors');
  167. $php_errormsg = '';
  168. if ($ini) {
  169. $this->connection = @call_user_func_array($connect_function,
  170. $params);
  171. } else {
  172. ini_set('track_errors', 1);
  173. $this->connection = @call_user_func_array($connect_function,
  174. $params);
  175. ini_set('track_errors', $ini);
  176. }
  177. if (!$this->connection) {
  178. if (($err = @msql_error()) != '') {
  179. return $this->raiseError(DB_ERROR_CONNECT_FAILED,
  180. null, null, null,
  181. $err);
  182. } else {
  183. return $this->raiseError(DB_ERROR_CONNECT_FAILED,
  184. null, null, null,
  185. $php_errormsg);
  186. }
  187. }
  188. if (!@msql_select_db($dsn['database'], $this->connection)) {
  189. return $this->msqlRaiseError();
  190. }
  191. return DB_OK;
  192. }
  193. // }}}
  194. // {{{ disconnect()
  195. /**
  196. * Disconnects from the database server
  197. *
  198. * @return bool TRUE on success, FALSE on failure
  199. */
  200. function disconnect()
  201. {
  202. $ret = @msql_close($this->connection);
  203. $this->connection = null;
  204. return $ret;
  205. }
  206. // }}}
  207. // {{{ simpleQuery()
  208. /**
  209. * Sends a query to the database server
  210. *
  211. * @param string the SQL query string
  212. *
  213. * @return mixed + a PHP result resrouce for successful SELECT queries
  214. * + the DB_OK constant for other successful queries
  215. * + a DB_Error object on failure
  216. */
  217. function simpleQuery($query)
  218. {
  219. $this->last_query = $query;
  220. $query = $this->modifyQuery($query);
  221. $result = @msql_query($query, $this->connection);
  222. if (!$result) {
  223. return $this->msqlRaiseError();
  224. }
  225. // Determine which queries that should return data, and which
  226. // should return an error code only.
  227. if (DB::isManip($query)) {
  228. $this->_result = $result;
  229. return DB_OK;
  230. } else {
  231. $this->_result = false;
  232. return $result;
  233. }
  234. }
  235. // }}}
  236. // {{{ nextResult()
  237. /**
  238. * Move the internal msql result pointer to the next available result
  239. *
  240. * @param a valid fbsql result resource
  241. *
  242. * @access public
  243. *
  244. * @return true if a result is available otherwise return false
  245. */
  246. function nextResult($result)
  247. {
  248. return false;
  249. }
  250. // }}}
  251. // {{{ fetchInto()
  252. /**
  253. * Places a row from the result set into the given array
  254. *
  255. * Formating of the array and the data therein are configurable.
  256. * See DB_result::fetchInto() for more information.
  257. *
  258. * This method is not meant to be called directly. Use
  259. * DB_result::fetchInto() instead. It can't be declared "protected"
  260. * because DB_result is a separate object.
  261. *
  262. * PHP's mSQL extension did weird things with NULL values prior to PHP
  263. * 4.3.11 and 5.0.4. Make sure your version of PHP meets or exceeds
  264. * those versions.
  265. *
  266. * @param resource $result the query result resource
  267. * @param array $arr the referenced array to put the data in
  268. * @param int $fetchmode how the resulting array should be indexed
  269. * @param int $rownum the row number to fetch (0 = first row)
  270. *
  271. * @return mixed DB_OK on success, NULL when the end of a result set is
  272. * reached or on failure
  273. *
  274. * @see DB_result::fetchInto()
  275. */
  276. function fetchInto($result, &$arr, $fetchmode, $rownum = null)
  277. {
  278. if ($rownum !== null) {
  279. if (!@msql_data_seek($result, $rownum)) {
  280. return null;
  281. }
  282. }
  283. if ($fetchmode & DB_FETCHMODE_ASSOC) {
  284. $arr = @msql_fetch_array($result, MSQL_ASSOC);
  285. if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE && $arr) {
  286. $arr = array_change_key_case($arr, CASE_LOWER);
  287. }
  288. } else {
  289. $arr = @msql_fetch_row($result);
  290. }
  291. if (!$arr) {
  292. return null;
  293. }
  294. if ($this->options['portability'] & DB_PORTABILITY_RTRIM) {
  295. $this->_rtrimArrayValues($arr);
  296. }
  297. if ($this->options['portability'] & DB_PORTABILITY_NULL_TO_EMPTY) {
  298. $this->_convertNullArrayValuesToEmpty($arr);
  299. }
  300. return DB_OK;
  301. }
  302. // }}}
  303. // {{{ freeResult()
  304. /**
  305. * Deletes the result set and frees the memory occupied by the result set
  306. *
  307. * This method is not meant to be called directly. Use
  308. * DB_result::free() instead. It can't be declared "protected"
  309. * because DB_result is a separate object.
  310. *
  311. * @param resource $result PHP's query result resource
  312. *
  313. * @return bool TRUE on success, FALSE if $result is invalid
  314. *
  315. * @see DB_result::free()
  316. */
  317. function freeResult($result)
  318. {
  319. return @msql_free_result($result);
  320. }
  321. // }}}
  322. // {{{ numCols()
  323. /**
  324. * Gets the number of columns in a result set
  325. *
  326. * This method is not meant to be called directly. Use
  327. * DB_result::numCols() instead. It can't be declared "protected"
  328. * because DB_result is a separate object.
  329. *
  330. * @param resource $result PHP's query result resource
  331. *
  332. * @return int the number of columns. A DB_Error object on failure.
  333. *
  334. * @see DB_result::numCols()
  335. */
  336. function numCols($result)
  337. {
  338. $cols = @msql_num_fields($result);
  339. if (!$cols) {
  340. return $this->msqlRaiseError();
  341. }
  342. return $cols;
  343. }
  344. // }}}
  345. // {{{ numRows()
  346. /**
  347. * Gets the number of rows in a result set
  348. *
  349. * This method is not meant to be called directly. Use
  350. * DB_result::numRows() instead. It can't be declared "protected"
  351. * because DB_result is a separate object.
  352. *
  353. * @param resource $result PHP's query result resource
  354. *
  355. * @return int the number of rows. A DB_Error object on failure.
  356. *
  357. * @see DB_result::numRows()
  358. */
  359. function numRows($result)
  360. {
  361. $rows = @msql_num_rows($result);
  362. if ($rows === false) {
  363. return $this->msqlRaiseError();
  364. }
  365. return $rows;
  366. }
  367. // }}}
  368. // {{{ affected()
  369. /**
  370. * Determines the number of rows affected by a data maniuplation query
  371. *
  372. * 0 is returned for queries that don't manipulate data.
  373. *
  374. * @return int the number of rows. A DB_Error object on failure.
  375. */
  376. function affectedRows()
  377. {
  378. if (!$this->_result) {
  379. return 0;
  380. }
  381. return msql_affected_rows($this->_result);
  382. }
  383. // }}}
  384. // {{{ nextId()
  385. /**
  386. * Returns the next free id in a sequence
  387. *
  388. * @param string $seq_name name of the sequence
  389. * @param boolean $ondemand when true, the seqence is automatically
  390. * created if it does not exist
  391. *
  392. * @return int the next id number in the sequence.
  393. * A DB_Error object on failure.
  394. *
  395. * @see DB_common::nextID(), DB_common::getSequenceName(),
  396. * DB_msql::createSequence(), DB_msql::dropSequence()
  397. */
  398. function nextId($seq_name, $ondemand = true)
  399. {
  400. $seqname = $this->getSequenceName($seq_name);
  401. $repeat = false;
  402. do {
  403. $this->pushErrorHandling(PEAR_ERROR_RETURN);
  404. $result =& $this->query("SELECT _seq FROM ${seqname}");
  405. $this->popErrorHandling();
  406. if ($ondemand && DB::isError($result) &&
  407. $result->getCode() == DB_ERROR_NOSUCHTABLE) {
  408. $repeat = true;
  409. $this->pushErrorHandling(PEAR_ERROR_RETURN);
  410. $result = $this->createSequence($seq_name);
  411. $this->popErrorHandling();
  412. if (DB::isError($result)) {
  413. return $this->raiseError($result);
  414. }
  415. } else {
  416. $repeat = false;
  417. }
  418. } while ($repeat);
  419. if (DB::isError($result)) {
  420. return $this->raiseError($result);
  421. }
  422. $arr = $result->fetchRow(DB_FETCHMODE_ORDERED);
  423. $result->free();
  424. return $arr[0];
  425. }
  426. // }}}
  427. // {{{ createSequence()
  428. /**
  429. * Creates a new sequence
  430. *
  431. * Also creates a new table to associate the sequence with. Uses
  432. * a separate table to ensure portability with other drivers.
  433. *
  434. * @param string $seq_name name of the new sequence
  435. *
  436. * @return int DB_OK on success. A DB_Error object on failure.
  437. *
  438. * @see DB_common::createSequence(), DB_common::getSequenceName(),
  439. * DB_msql::nextID(), DB_msql::dropSequence()
  440. */
  441. function createSequence($seq_name)
  442. {
  443. $seqname = $this->getSequenceName($seq_name);
  444. $res = $this->query('CREATE TABLE ' . $seqname
  445. . ' (id INTEGER NOT NULL)');
  446. if (DB::isError($res)) {
  447. return $res;
  448. }
  449. $res = $this->query("CREATE SEQUENCE ON ${seqname}");
  450. return $res;
  451. }
  452. // }}}
  453. // {{{ dropSequence()
  454. /**
  455. * Deletes a sequence
  456. *
  457. * @param string $seq_name name of the sequence to be deleted
  458. *
  459. * @return int DB_OK on success. A DB_Error object on failure.
  460. *
  461. * @see DB_common::dropSequence(), DB_common::getSequenceName(),
  462. * DB_msql::nextID(), DB_msql::createSequence()
  463. */
  464. function dropSequence($seq_name)
  465. {
  466. return $this->query('DROP TABLE ' . $this->getSequenceName($seq_name));
  467. }
  468. // }}}
  469. // {{{ quoteIdentifier()
  470. /**
  471. * mSQL does not support delimited identifiers
  472. *
  473. * @param string $str the identifier name to be quoted
  474. *
  475. * @return object a DB_Error object
  476. *
  477. * @see DB_common::quoteIdentifier()
  478. * @since Method available since Release 1.7.0
  479. */
  480. function quoteIdentifier($str)
  481. {
  482. return $this->raiseError(DB_ERROR_UNSUPPORTED);
  483. }
  484. // }}}
  485. // {{{ escapeSimple()
  486. /**
  487. * Escapes a string according to the current DBMS's standards
  488. *
  489. * @param string $str the string to be escaped
  490. *
  491. * @return string the escaped string
  492. *
  493. * @see DB_common::quoteSmart()
  494. * @since Method available since Release 1.7.0
  495. */
  496. function escapeSimple($str)
  497. {
  498. return addslashes($str);
  499. }
  500. // }}}
  501. // {{{ msqlRaiseError()
  502. /**
  503. * Produces a DB_Error object regarding the current problem
  504. *
  505. * @param int $errno if the error is being manually raised pass a
  506. * DB_ERROR* constant here. If this isn't passed
  507. * the error information gathered from the DBMS.
  508. *
  509. * @return object the DB_Error object
  510. *
  511. * @see DB_common::raiseError(),
  512. * DB_msql::errorNative(), DB_msql::errorCode()
  513. */
  514. function msqlRaiseError($errno = null)
  515. {
  516. $native = $this->errorNative();
  517. if ($errno === null) {
  518. $errno = $this->errorCode($native);
  519. }
  520. return $this->raiseError($errno, null, null, null, $native);
  521. }
  522. // }}}
  523. // {{{ errorNative()
  524. /**
  525. * Gets the DBMS' native error message produced by the last query
  526. *
  527. * @return string the DBMS' error message
  528. */
  529. function errorNative()
  530. {
  531. return @msql_error();
  532. }
  533. // }}}
  534. // {{{ errorCode()
  535. /**
  536. * Determines PEAR::DB error code from the database's text error message
  537. *
  538. * @param string $errormsg the error message returned from the database
  539. *
  540. * @return integer the error number from a DB_ERROR* constant
  541. */
  542. function errorCode($errormsg)
  543. {
  544. static $error_regexps;
  545. if (!isset($error_regexps)) {
  546. $error_regexps = array(
  547. '/^Access to database denied/i'
  548. => DB_ERROR_ACCESS_VIOLATION,
  549. '/^Bad index name/i'
  550. => DB_ERROR_ALREADY_EXISTS,
  551. '/^Bad order field/i'
  552. => DB_ERROR_SYNTAX,
  553. '/^Bad type for comparison/i'
  554. => DB_ERROR_SYNTAX,
  555. '/^Can\'t perform LIKE on/i'
  556. => DB_ERROR_SYNTAX,
  557. '/^Can\'t use TEXT fields in LIKE comparison/i'
  558. => DB_ERROR_SYNTAX,
  559. '/^Couldn\'t create temporary table/i'
  560. => DB_ERROR_CANNOT_CREATE,
  561. '/^Error creating table file/i'
  562. => DB_ERROR_CANNOT_CREATE,
  563. '/^Field .* cannot be null$/i'
  564. => DB_ERROR_CONSTRAINT_NOT_NULL,
  565. '/^Index (field|condition) .* cannot be null$/i'
  566. => DB_ERROR_SYNTAX,
  567. '/^Invalid date format/i'
  568. => DB_ERROR_INVALID_DATE,
  569. '/^Invalid time format/i'
  570. => DB_ERROR_INVALID,
  571. '/^Literal value for .* is wrong type$/i'
  572. => DB_ERROR_INVALID_NUMBER,
  573. '/^No Database Selected/i'
  574. => DB_ERROR_NODBSELECTED,
  575. '/^No value specified for field/i'
  576. => DB_ERROR_VALUE_COUNT_ON_ROW,
  577. '/^Non unique value for unique index/i'
  578. => DB_ERROR_CONSTRAINT,
  579. '/^Out of memory for temporary table/i'
  580. => DB_ERROR_CANNOT_CREATE,
  581. '/^Permission denied/i'
  582. => DB_ERROR_ACCESS_VIOLATION,
  583. '/^Reference to un-selected table/i'
  584. => DB_ERROR_SYNTAX,
  585. '/^syntax error/i'
  586. => DB_ERROR_SYNTAX,
  587. '/^Table .* exists$/i'
  588. => DB_ERROR_ALREADY_EXISTS,
  589. '/^Unknown database/i'
  590. => DB_ERROR_NOSUCHDB,
  591. '/^Unknown field/i'
  592. => DB_ERROR_NOSUCHFIELD,
  593. '/^Unknown (index|system variable)/i'
  594. => DB_ERROR_NOT_FOUND,
  595. '/^Unknown table/i'
  596. => DB_ERROR_NOSUCHTABLE,
  597. '/^Unqualified field/i'
  598. => DB_ERROR_SYNTAX,
  599. );
  600. }
  601. foreach ($error_regexps as $regexp => $code) {
  602. if (preg_match($regexp, $errormsg)) {
  603. return $code;
  604. }
  605. }
  606. return DB_ERROR;
  607. }
  608. // }}}
  609. // {{{ tableInfo()
  610. /**
  611. * Returns information about a table or a result set
  612. *
  613. * @param object|string $result DB_result object from a query or a
  614. * string containing the name of a table.
  615. * While this also accepts a query result
  616. * resource identifier, this behavior is
  617. * deprecated.
  618. * @param int $mode a valid tableInfo mode
  619. *
  620. * @return array an associative array with the information requested.
  621. * A DB_Error object on failure.
  622. *
  623. * @see DB_common::setOption()
  624. */
  625. function tableInfo($result, $mode = null)
  626. {
  627. if (is_string($result)) {
  628. /*
  629. * Probably received a table name.
  630. * Create a result resource identifier.
  631. */
  632. $id = @msql_query("SELECT * FROM $result",
  633. $this->connection);
  634. $got_string = true;
  635. } elseif (isset($result->result)) {
  636. /*
  637. * Probably received a result object.
  638. * Extract the result resource identifier.
  639. */
  640. $id = $result->result;
  641. $got_string = false;
  642. } else {
  643. /*
  644. * Probably received a result resource identifier.
  645. * Copy it.
  646. * Deprecated. Here for compatibility only.
  647. */
  648. $id = $result;
  649. $got_string = false;
  650. }
  651. if (!is_resource($id)) {
  652. return $this->raiseError(DB_ERROR_NEED_MORE_DATA);
  653. }
  654. if ($this->options['portability'] & DB_PORTABILITY_LOWERCASE) {
  655. $case_func = 'strtolower';
  656. } else {
  657. $case_func = 'strval';
  658. }
  659. $count = @msql_num_fields($id);
  660. $res = array();
  661. if ($mode) {
  662. $res['num_fields'] = $count;
  663. }
  664. for ($i = 0; $i < $count; $i++) {
  665. $tmp = @msql_fetch_field($id);
  666. $flags = '';
  667. if ($tmp->not_null) {
  668. $flags .= 'not_null ';
  669. }
  670. if ($tmp->unique) {
  671. $flags .= 'unique_key ';
  672. }
  673. $flags = trim($flags);
  674. $res[$i] = array(
  675. 'table' => $case_func($tmp->table),
  676. 'name' => $case_func($tmp->name),
  677. 'type' => $tmp->type,
  678. 'len' => msql_field_len($id, $i),
  679. 'flags' => $flags,
  680. );
  681. if ($mode & DB_TABLEINFO_ORDER) {
  682. $res['order'][$res[$i]['name']] = $i;
  683. }
  684. if ($mode & DB_TABLEINFO_ORDERTABLE) {
  685. $res['ordertable'][$res[$i]['table']][$res[$i]['name']] = $i;
  686. }
  687. }
  688. // free the result only if we were called on a table
  689. if ($got_string) {
  690. @msql_free_result($id);
  691. }
  692. return $res;
  693. }
  694. // }}}
  695. // {{{ getSpecialQuery()
  696. /**
  697. * Obtain a list of a given type of objects
  698. *
  699. * @param string $type the kind of objects you want to retrieve
  700. *
  701. * @return array the array containing the list of objects requested
  702. *
  703. * @access protected
  704. * @see DB_common::getListOf()
  705. */
  706. function getSpecialQuery($type)
  707. {
  708. switch ($type) {
  709. case 'databases':
  710. $id = @msql_list_dbs($this->connection);
  711. break;
  712. case 'tables':
  713. $id = @msql_list_tables($this->dsn['database'],
  714. $this->connection);
  715. break;
  716. default:
  717. return null;
  718. }
  719. if (!$id) {
  720. return $this->msqlRaiseError();
  721. }
  722. $out = array();
  723. while ($row = @msql_fetch_row($id)) {
  724. $out[] = $row[0];
  725. }
  726. return $out;
  727. }
  728. // }}}
  729. }
  730. /*
  731. * Local variables:
  732. * tab-width: 4
  733. * c-basic-offset: 4
  734. * End:
  735. */
  736. ?>