Topic: bunch of code of php


specific    -- 03-07-2008 @ 1:13 PM
  Hi, today i got a code from one PHP project which was told me to convert in cfml. But i went through the code and it uses the classes for everything.. So i was bit confused on this, how can is do this to cfm, can anyone help please

Thanks


Webmaster    -- 03-07-2008 @ 1:59 PM
  Can we see some code examples?

Pablo Varando
Senior Application Architect
EasyCFM.COM, LLC.

904.483.1457 \\ mobile
webmaster@easycfm.com \\email


specific    -- 03-07-2008 @ 2:13 PM
  function fetch_customer(&$params)
{
$query = ‘select * from customers where ! = ?’;

if (!empty($params[‘customer_id’]))
{
$bind = array(‘customer_id’, (int)$params[‘customer_id’]);
}
elseif (!empty($params[‘customer_code’]))
{
$bind = array(‘customer_code’, $params[‘customer_code’]);
}
else
{
user_error(
‘Could not fetch customer - no ID or code specified’
, E_USER_ERROR
);
return FALSE;
}
$dbh = db_connect();
$record = $dbh->getRow($query, $bind, DB_FETCHMODE_ASSOC);
if ($record === FALSE)
{
$private_error = ‘fetch_customer: error in query: ‘
. $dbh->last_query
;
user_error(
‘Could not fetch customer from database’
, E_USER_ERROR
);
return FALSE;
}
$params = array_merge($params, $record);
return TRUE;
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The Door to Coldfusion Community Will Remain Open Till World Ends

Want a Web Portal Contact Me

randhawaz81@gmail.com

<cf_visitwebsite>

http://portal.randhawaworld.com/

</cf_visitwebsite>


EasyCFM.COM ColdFusion Forums : http://archive.easycfm.com/forums
Topic: http://archive.easycfm.com/forums/viewmessages.cfm?Forum=27&Topic=13244