You are here: PDO Gnashing of teeth and pulling of hair. « PHP Programming Language « IT news, forums, messages
PDO Gnashing of teeth and pulling of hair.

Posted by smorrey on 10/03/05 11:28

Assuming this...
$_SESSION['db'] = new PDO(
"pgsql:dbname=test;host=localhost",
"biocoinadmin",
"xxxxxxxxxx"
);


What is wrong with this (line breaks added for clarity)?

$sql = "SELECT * FROM public.authinfo WHERE uid = '$uid'";
if ($_SESSION['db']->fetchAll(
$_SESSION['db']->query($sql)) > 0
){
dosomething();
}else{
dosomethingelse();
}

I keep getting this error...

Fatal error: Call to undefined method PDO::fetchAll() in
/home/testcode/public_html/header.php on line 114

This doesn't make sense, because every other query I issue on the DB
seems to be working great. This is the first time anykind of fetch is
used, and it should just let me know if there is any data at all, as a
result of the query right? I'm not asking for anything specific just a
yes or no as to whether that uid exists in the DB.

Any advice here?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация