view some data in text mode, is it possible?
drein - October 30, 2007 - 09:10
| Project: | Table Manager |
| Version: | 5.x-1.4 |
| Component: | Miscellaneous |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi,
I'm using tablemanager from 5 6 days, it is simply great.
Now I have a question quite urgent for me, tell me if I can solve it with tablemanager or with php, or if I can't solve it!
I have a large table with lots of data.
I'd like to display time to time some data, but not with the table format, just simply as text.
So, for istance, I'd like to recall some data in a cell, "show me data contained in column 6, rows 9".
Is it possibile with tablemanager?
if not, Can I use a php script that extract data from the mysql?
I don't know how Tablemanager store data into the db, so please, if you could show me some examples it should be great!
Thanks anyway for this project.

#1
It'll be easier in the next version as it'll actually store the data in table/row/cell format. Unfortunately... In the current version it's a bit more long winded than that... How you do this will depend on what you want to achieve, so I'll assume that you *don't* require the sorted 'version' of your table and you simply wish to return the data based on the order it's been input.
<?php$tid = 1; // obviously this is the numeric table id
$row = 2; // equates to field 'id'
$cell = 1; // note that with arrays, '0' is the first cell, '1' the second, etc...
$query = db_query('SELECT tmd.data FROM {tablemanager_data} tmd
WHERE tmd.tid = %d AND tmd.id = %d',
$tid, $row);
$fetch = db_fetch_object($query);
$row = unserialize($fetch->data);
print $row[$cell];
?>
Again in this old version of Tablemanager, there is no function to display formatted data without manually checking it - AGAIN, this is done correctly in the new unreleased version, but I'm unwilling to release it to the community until I'm completely happy with it - which isn't quite yet...
Pobster
#2
hmmm ok, I can say it is not very simple for me because I must recall often data from tables. Anyway, having the structure of the table in a more accessible Sql format should be very helpful. I read that in the new version of TableManager this will be easier, so...
when do you think to make the new release?
I think this is a good module, I created tables really with no difficulty.
Also a Pre-pre-pre-pre-alpha version will be ok! :-)
Thanks again.
#3
I'm afraid I have no timescale as to when I'm going to make the next release... It's a project I'm working on for myself (unlike some of my other modules which are sponsored) and as such it has no deadline.
I'm *really* reluctant to make any alpha releases at all as I'm constantly making huge fundamental changes to it (well, not entirely right at this moment... I haven't actually touched it at all this month!) and I'm not willing to be responsible for making bulletproof install file table db conversions as there will undoubtedly be someone somewhere (probably America...!) who will still use it on a production site! I think I'd much rather wait until I've at least settled on the db structure before I make any new releases at all. The code is strong though, I'm really looking forward to having people use it - I really think it's a huge leap forward, heh - maybe I should have applied for one of those Knight News Challenge awards and taken some time off work to actually dedicate a bit of time to it!
Thanks,
Pobster
#4
ok, only the last thing:
last question:
if it is possible to obtain a view of a table containing only specific columns? for example, only the first and third, or 4, 7 and 9?
and the same thing also for the rows?
thanks again.
#5
Columns... No... Not 'out-of-the-box' although again... And you're going to get sick of hearing me say it... The new version allows you to hide columns and the old version doesn't... Of course though, if you're willing to build the entire table yourself in a php function then you can have all the flexibility you want - don't forget that tables are just multi-dimensional arrays and as such you can use phps powerful array functions with them (http://uk.php.net/manual/en/ref.array.php) to achieve many 'effects'.
Rows... Yes... Well sort of anyway, someone once requested the ability to display a range of dates from one of their tables and the resulting code worked well enough for me to implement it. It's in the documentation;
If you wish to restrict the rows displayed you can do so by passing arguments to the filter like this:
[tablemanager:1, NULL, FALSE, column = 2 | start = "a" | end = "h"]Hope this helps,
Pobster
#6
http://drupal.org/node/370461
#7