Calling testimonial module in magento using code -


i trying show testimonial on home page using php code in magento

i tried code below getcollection or without getcollection function

$collection = mage::getmodel('turnkeye/testimonial'); 

may calling correct model ??

module init code should turnkeye_testimonial/testimonial instead of turnkeye/testimonial if want field individual item can primary key of testimonial table .

$collection $model = mage::getmodel('turnkeye_testimonial/testimonial')>load(id); 

if want fetch multiple items need resource collection

mage::getresourcemodel('turnkeye_testimonial/testimonial')->addfieldtoselect('*'); 

or

$collection = mage::getmodel('turnkeye_testimonial/testimonial')->getcollection(); 

for random collection

$collection=mage::getmodel('turnkeye_testimonial/testimonial')->getcollection();  $collection->getselect()->order('rand()'); 

some reference

http://www.amitbera.com/create-an-magento-extension-with-custom-database-table/


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -