我需要找到以下的正常sql查询.你们能告诉我如何在Symfony取得成功吗?
例:
$r = Doctrine_Query::create()
->select('u.worked_hours')
->from('tasksComments u')
->where('u.tasks_id = ?', $arr_values['tasks_id'])
->andwhere('u.id != ?', $arr_values['id'])
->andwhere('u.created_at LIKE ?', $date."%");
$results1 = $r->execute();
Run Code Online (Sandbox Code Playgroud)
在查询对象上,使用该方法getSQL.
在你的情况下:
$r = Doctrine_Query::create()
->select('u.worked_hours')
->from('tasksComments u')
->where('u.tasks_id = ?', $arr_values['tasks_id'])
->andwhere('u.id != ?', $arr_values['id'])
->andwhere('u.created_at LIKE ?', $date."%");
var_dump($r->getSQL()); // print the SQL query - you will need to replace the parameters in the query
var_dump($r->getParams()); // print the parameters of the query so you can easily replace the missing parameters in the query
Run Code Online (Sandbox Code Playgroud)
请注意,我不知道命名空间,Doctrine_Query但我假设你的Query对象在Doctrine API文档中的这个Query对象中.
| 归档时间: |
|
| 查看次数: |
7054 次 |
| 最近记录: |