Login   Register  
PHP Classes
elePHPant
Icontem

Spinning star, no data in table

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      DrasticTools  >  All threads  >  Spinning star, no data in table  >  (Un) Subscribe thread alerts  
Subject:Spinning star, no data in table
Summary:I'm a noob, so please be nice...I read alot before asking.
Messages:2
Author:Nathan Elliott
Date:2007-04-24 18:59:11
Update:2007-04-24 19:51:38
 

  1. Spinning star, no data in table   Reply   Report abuse  
Picture of Nathan Elliott
Nathan Elliott
2007-04-24 18:59:11
I have one database with several tables. I am using a simple HTML form on the front page of my site to select the table. The main page using drasticGrid gets the tablename from the previous page via POST:

$table=$_POST['headend'];

and I add it to the $src definition like so:

$src = new drasticSrcMySQL(localhost, web, "", Headends, $table, $options);

I have verified the data is being passed properly to the main page via POST, but the table doesn't load, I just get the spinning star.

If I replace "$table" with the actual name of the table, it works fine.

Is this a stupid noob mistake? I've been reading as much as I can find out variables and PHP, and I can't figure out what I'm doing wrong. =(

Thank you

  2. Re: Spinning star, no data in table   Reply   Report abuse  
Picture of dd
dd
2007-04-24 19:51:38 - In reply to message 1 from Nathan Elliott
Hi Nathan,

Not a stupid question at all. This is a problem related to the problem discussed in thread:

http://www.phpclasses.org/discuss/package/3444/thread/8/page ...

The grid uses an Ajax call to get the data into it.
This Ajax call is built within the javascript code and it calls the same .php file from which the javascript was invoked with a number of new GET variables (like op=v and start=0 etc), and without the _POST['headend'] the php file is reading out.
Therefore this call doen't give the right data back and the star spins and spins,.... This also explains why it does work if you name the table name in the php file, not via the (GET OR POST) variables.
So the conclusion is that, how sadly, the grid wasn't developed for the purpose of reading out critical information via GET or POST. I am thinking about a redesign that solves this problem.
Meanwhile, you could use cookies or read the information from a file or another source that you can reach from your php code to get the tablename, but not via the GET or POST parameters.