Is there any Online Web Tool that Convert mySQL Query To Zend FrameWork Query. that is i type mySql Query and the Tool Convert it to Zend FrameWork equivalent Query
1 Answer
You don't need a tool for this. Within Zend Framework's Zend_Db, component, you can do:
$stmt = $db->query($sql);
If $sql is a select, then you can retrieve the data with:
$rows = $stmt->fetchAll();
Alternatively, ZF is just a PHP framework, so there's nothing stopping you continuing to use PDO or mysqli directly.
2 Comments
Edward Maya
i know i can use mysql query,u know the difference b/w syntax of genral mysql query and zf query.zf query syntax is bit difficult so i need to convert mysql query to zf equailent query
Rob Allen
The SQL string is identical if you use
$db->query(). If you want to use the Zend_Db_Select object, then that is a different matter and you should post a separate question with an explicit SQL statement that you are trying to convert to Zend_Db_Select.
Zend_Db, or build the query usingZend_Db_SelectZend FrameWork equivalent Query. You actually have multiple options on how you want to build your queries in ZF. If you really want to work in SQL, execute your SQL queries with Zend_Db_Statement and enjoy.