Hi,
EDIT: The reason why my Doctrine queries (see below) did not work/produced those errors was because I left out
ci_doctrine.
when creating this database:
CREATE TABLE `ci_doctrine`.`user` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`username` VARCHAR( 255 ) NOT NULL ,
`password` VARCHAR( 255 ) NOT NULL ,
`first_name` VARCHAR( 255 ) NOT NULL ,
`last_name` VARCHAR( 255 ) NOT NULL ,
UNIQUE (`username`
)
)
END OF EDIT
How do I write plane SQL queries using Doctrine connection object and display the results? For example, how do I perform:
SELECT * FROM table_name WHERE column_name LIKE '%anything_similar_to_this%';
using Doctrine something like this (this example does not work)
$search_key = 'search_for_this';
$conn = Doctrine_Manager::connection();
$conn->execute('SELECT * FROM table_name WHERE column_name LIKE ?)', $search_key);
echo $conn;
I've also tried:
$search_key = 2;
$q = new Doctrine_RawSql();
$result = $q->select('column_name')
->from('table_name')
->where('id = ?', $search_key)
->execute();
echo $result;