scheduler render_sql was not working

Hi all,
I want to list data with conditions, I did like below:

[code]
require_once("…/Vendor/connector/grid_connector.php");
require_once("…/Vendor/connector/scheduler_connector.php");
require_once("…/Vendor/connector/db_phpcake.php");


$connector = new SchedulerConnector($this->Event, “PHPCake”);
$connector->render_sql(“select * from shift_infos where id = 2”,“event_id”,“start_date, end_date, title, description, staff_id, shop_id”);[/code]
But it’s not working, it returned all data from table ‘shift_infos’. That code returned result like this code:

$connector = new SchedulerConnector($this->Event, "PHPCake"); $connector->render_table("shift_infos","event_id","start_date, end_date, title, description, staff_id, shop_id");
No different.
Am I missing somthing… Thanks

Hi,

do you have in your DB table both columns “id” and “event_id” ?
If not, try to replace your SQL statement with:
(“SELECT * FROM shift_infos WHERE event_id = 2”,“event_id”,“start_date,end_date,…”)

Thanks for your reply!
I have both ‘id’ and ‘event_id’… :frowning:

It’s hard to say, you know. Your example seems to be correct, I tried to repeat it with both “id” and “event_id” columns - it works :

[code]<?php
include (“codebase/scheduler_connector.php”);
$res=mysql_connect(“host”, “login”, “password”);
mysql_select_db(“test”);

$scheduler = new SchedulerConnector($res);
$scheduler->render_sql(“SELECT * FROM events WHERE id = 2”, “event_id”, “start_date, end_date, text”);[/code]
Only if you want to return “id” column (“SELECT …”, “event_id”, “start_date, end_date, text, id”) - it will cause the trouble because only one field (“event_id” for this sample) can be used as “id” property.
Try to detect, what this simple SQL statement (“select * from shift_infos where id = 2”) returns, if all is correct.