Re: Datagrid and Excel
| From: | Justin Patrin | Date: | Mon, 28 Aug 2006 14:57:09 +0000 |
| Subject: | Re: Datagrid and Excel | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-25002@lists.php.net to get a copy of this message | ||
On 8/28/06, Köteles Zoltán <zoltan.koteles@chello.hu> wrote:
Hello,
I'd like to create an excel file with DataGrid, but I always get the full page not the only query result.
Here's my code:
$rankitem = intval($_GET['rit']);
require_once 'Structures/DataGrid.php';
$datagrid =& new Structures_DataGrid($rankitem);
$options = array('dsn' => 'mysql://gtk:******@localhost/gtk');
$result = $datagrid->bind("
SELECT u.user_id AS uid, u.name AS name, u.user_name AS username, rankpts+gpa AS points
FROM Users u
ORDER BY rankpts+gpa DESC", $options);
$datagrid->render(DATAGRID_RENDER_XLS);
How can I do that if I want to see only the query result not the full page?
There is no way from this code that DataGrid could *not* be using your
query. Perhaps you mean something different?
What do you mean by "query result"? It seems to be that the result of
your database query is what you should be seeing here.
What do you mean by "full page"?
--
Justin Patrin