[PHP-DB] [PDO] Number of rows found by Select

2005-11-08 Thread Rob C
What is the recommended way to find the number of rows found by a SELECT query? PDOStatement::rowCount() doesn't work with MySQL and is a bit of a hack anyway. Doing a COUNT(*) before the SELECT is very hackish - the data could have changed and it's an extra query. What is there that's better

Re: [PHP-DB] [PDO] Number of rows found by Select

2005-11-09 Thread Rob C
ment. mysql_num_rows() is specific to MySQL. He wants a PDO version. -Original Message- From: Micah Stevens [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 08, 2005 10:51 AM To: php-db@lists.php.net Subject: Re: [PHP-DB] [PDO] Number of rows found by Select mysql_num_rows() On Tu

Re: [PHP-DB] [PDO] Number of rows found by Select

2005-11-09 Thread Rob C
t = $rows_array[0]; if (!is_null($limit) && $count > $limit) { $count = $limit; } } } catch (PDOException $e) { # todo } return $stmt; } Rob Rob C wrote: So would it be possible to write a select() function to handle the wierdness? I'm attempting to write one but I&#

[PHP-DB] Re: Amount of characters a variable is able to contain

2005-11-17 Thread Rob C
I don't believe there is a way with file(), but there are alternatives. Firstly, does it need to be in an array? Does your script do anything else with $lineArray? If not, you'd be much better off just using file_get_contents() (http://php.net/file_get_contents) or, if you just want to output