Re: Weird result set from PEAR's DB
| From: | Joe Stump | Date: | Tue, 29 Mar 2005 19:34:50 +0000 |
| Subject: | Re: Weird result set from PEAR's DB | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-36967@lists.php.net to get a copy of this message | ||
There is no error. The array I showed you is the result of my $result->fetchRow(). Everything works fine, except that the keys are completely boned. I've tracked the problem down further and found that the raw response from the line in DB_mysql::fetchInto() is returning a boned array:
$arr = @mysql_fetch_array($result, MYSQL_ASSOC);A print_r on $arr gives me this: Array (
[@] => 1
[
@] => joe@joestump.net
[] => 1
[ @] => 1
)
Other queries work just fine. It's quite strange.
--Joe
--
Joseph C. Stump
joe@joestump.net
http://www.joestump.net
On Mar 29, 2005, at 11:03 AM, Daniel Convissor wrote:
On Tue, Mar 29, 2005 at 10:58:37AM -0800, Joe Stump wrote:Oddly enough changing the query from: SELECT * FROM users WHERE username='foo@example.com' to: SELECT * FROM mydb.users WHERE username='foo@example.com'And what happens when you check the result for errors? $res =& $db->query("SELECT * FROM users WHERE username='foo@example.com'"); if (DB::isError($res)) {echo $res->getDebugInfo() . "\n";} else {echo "The query ran fine\n";} --Dan -- T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Ydata intensive web and database programming http://www.AnalysisAndSolutions.com/4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409 -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php