<?php
//select query
$read = Mage::getSingleton(‘core/resource’)->getConnection(‘core_read’);
//make connection
$qry = “select name FROM user_data WHERE id=1 LIMIT 1 “;
//query
$res = $read->fetchRow($qry); //fetch row
$name = $res[‘name’]; //outputs name
//other form
$qry = “select name FROM user_data WHERE namer LIKE ‘%a%’ “;
//query
$res = $read->fetchAll($qry); //get array
//Insert query
$write = Mage::getSingleton(‘core/resource’)->getConnection(‘core_write’);
$sql = “INSERT INTO user_data values (?,?)”; //insert query
$write->query($sql, array(‘name’,’pass’)); //write to database
?>
Hi, thx for the help.
Do you know how to get the number of affected row by an UPDATE with a custom query in magento ?
Hi this is kind of of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML.
I’m starting a blog soon but have no coding knowledge so I wanted to get advice from someone with experience. Any help would be greatly appreciated!
Have you ever considered creating an ebook or guest authoring on other
websites? I have a blog centered on the same subjects you discuss and
would love to have you share some stories/information.
I know my subscribers would value your work.
If you’re even remotely interested, feel free to send me an e mail.
Hi there, always i used to check blog posts here in the early hours in the daylight,
for the reason that i enjoy to learn more and more.
Hey! I’m at work surfing around your blog from my new iphone 4! Just wanted to say I love reading through your blog and look forward to all your posts! Keep up the outstanding work!
What’s up, its fastidious piece of writing concerning media print, we all know media is a great source of facts.
Sweet blog! I found it while surfing around on Yahoo
News. Do you have any tips on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there! Many thanks
Unquestionably believe that which you stated. Your favorite justification appeared
to be on the net the simplest thing to be aware of. I say to you, I definitely get
irked while people consider worries that they just do not
know about. You managed to hit the nail upon the top and defined out
the whole thing without having side effect , people can take
a signal. Will likely be back to get more. Thanks