EasyCFM.COM ColdFusion Forums / PHP to CFML / bunch of code of php

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: bunch of code of php

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

specific
03-07-2008 @ 1:13 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 897
Joined: Apr 2006

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
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

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
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Senior Member
Posts: 897
Joined: Apr 2006

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>


Website Designed and Developed by Pablo Varando.