Categories > TinyButStrong general >

Query String in block - should be simple

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Kevin Minnelli
Date: 2008-04-14
Time: 20:55

Query String in block - should be simple

Okay – I have an issue I can’t get past. I have a table of results from a db query. Lets say it looks like:

HTML Code Visual is in a table and looks good.

Heading A     | Heading B      | Heading C
[blk1.DriverID;block=tr]  | [blk1.DriverName;block=tr]     | [blk1.Points;block=tr]

So note, the DriverID is the key I want to link to but need it has the link on the DriverName. Example:

1    Joe Smith----need it to link to foo.php?DriverID=1
2    Tom Kelly----need it to link to foo.php?DriverID=2
3    Jim Jones----need it to link to foo.php?DriverID=3

So if you hover over any of the driver names it has the link to their driver page with their information.

Php Code – is fine sql works perfect but just in case you need to see it.

<?php
include_once('tbs_class_php5.php') ;
include ('cnx_mysql.php');
$TBS = new clsTinyButStrong ;
$sql="SELECT * FROM Standings;
$TBS->LoadTemplate('tbs_driver.htm') ;
$TBS->MergeBlock('blk1',$cnx_id, $sql) ;
mysql_close($cnx_id) ;
$TBS->Show() ;
?>

I really really appreciate the help. Thanks in advance.

Minnelli
By: TomH
Date: 2008-04-14
Time: 22:21

Re: Query String in block - should be simple

Please post the actual template (html) code for help on this kind of stuff, a lot easier to help you that way (and always cut and past from your actual files - typing in pseudo-code is a real no-no).

But to make a link just write the html for the link...
for example, like this in your second column
<a href=foo.php?DriverID=[blk1.DriverID;]>[blk1.DriverName;] </a>

And just a note... you only need the block=tr once in the template for the one block.

By: Kevin Minnelli
Date: 2008-04-15
Time: 02:29

Re: Query String in block - should be simple

I have to say you were 100% wrong :) you forgot the quotes. THANK YOU SOOOO MUCH. I was dying trying to find a solution. I was even looking to go back to straight php, which would have been a nightmare for me.

<a href="foo.php?DriverID=[blk2.DriverID;]">[blk2.DriverName]</a>

I'm sorry I didn't paste the whole code, next time I will just cut out the area I need help with, but you figured out what I needed so again a big thanks...

FYI for anyone searching on query string php html dreamweaver here is a tip for the gui non-command line type folks like myself. In dreamweaver, etc. just do your normal block [blk2.WhatEver;] and in the link field just include the foo.php?WhatEverID=[blk2.WhatEverID;]

Also thanks for the tip on only one block=tr per block.

Minnelli