Reply to PHP and MS Access Record Count

Your name:

Reply:


Posted by thomasp on 12/09/16 11:26

I am trying to get a record count of a PHP query on a MS Acess database
using ODBC with a DSN for MS ACCESS connection. I got this code from the
PHP manual user notes. It seems to return the correct recount if the count
is greater than 0. It the count is 0 it returns the value of the $transid
variable in the code. Can someone tell me what I am doing wrong? I need
something that returns 0 if not records are found and an accurate count if
records are found. This seems like overkill to get a simple record count.
Thanks,
Thomas

function recordcount($conn,$transid) {
$sql = "SELECT COUNT(*) FROM tblTransaction WHERE TransID = '$transid'";
$query = odbc_prepare($conn,$sql) or die("ERROR");
odbc_execute($query) or die("ERROR");
$rc = odbc_fetch_into($query, $mycount);
$count = $mycount[0];
return $count;
}

--
Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
------->>>>>>http://www.NewsDemon.com<<<<<<------
Unlimited Access, Anonymous Accounts, Uncensored Broadband Access

[Back to original 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

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