You are here Support Forums
Search:  
putting html strings in the output?
Last Post 03 Feb 2006 08:27 AM by c4l3b. 6 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
c4l3b
New Member
New Member
Posts:2

--
"); print (""); print (""); print (""); print (""); note the second to last line where I have inserted some information onto the result... is this possible in the module?
03 Feb 2006 08:27 AM  
hello all, I need to put a bit of html in the display of a column... example: http://www.fanatexe.com/users_last.php I have gotten the sql module to retrieve the information perfectly, but my table only includes the image name. I was using the following php to achieve the effect wanted: //connect to the database $connectionstring = odbc_connect("xxx", "xxx", "xxx"); //SQL query $Query = "SELECT firstname, lastname, username, imagepath FROM users ORDER BY lastname "; //execute query $queryexe = odbc_do($connectionstring, $Query); //query database while(odbc_fetch_row($queryexe)) { $firstname = odbc_result($queryexe, 1); $lastname = odbc_result($queryexe, 2); $username = odbc_result($queryexe, 3); $imagepath = odbc_result($queryexe, 4); //format results print ("
$firstname$lastname$username"); print ("
Richard Edwards
DNNStuff Founder
Veteran Member
Veteran Member
Posts:1207
Avatar

--
03 Feb 2006 02:54 PM  
Yes, it's quite possible. In place of your individual fields, just concatenate the required html onto the field data. In your example, you could do something like this: SELECT '' AS ImagePathTitle FROM Users This would return html inside the column that showed the image.


Richard Edwards
DNNStuff Founder
Did you receive excellent support? Consider leaving a testimonial
c4l3b
New Member
New Member
Posts:2

--
03 Feb 2006 09:09 PM  
Is it also possible to pass input from a form to select specific results? in example: show all collumns where affiliate code = 12345 (they have to enter their affiliate code before the query is run)?
Richard Edwards
DNNStuff Founder
Veteran Member
Veteran Member
Posts:1207
Avatar

--
03 Feb 2006 11:02 PM  
You can use Query String parameters, [QUERYSTRING:val] where val is the querystring parameter. For example, you could do: SELECT * FROM USERS where AffiliateId = [QUERYSTRING:AffiliateId] and if the url was http://www.myplace.com/default.asp?AffiliateId=1234 it would execute SELECT * FROM USERS where AffiliateId = 1234


Richard Edwards
DNNStuff Founder
Did you receive excellent support? Consider leaving a testimonial
Jeff Bishop
New Member
New Member
Posts:2

--
24 Feb 2006 10:29 AM  
One thing I found out is that the sorting doesn't work properly on the column that contains the html. for example I have a grid of names and the name links to a page for that person's name. With the html added in there the sort will order by the whole link's html value not the actual value of the field. How would one go about this? Thanks, Kev
Richard Edwards
DNNStuff Founder
Veteran Member
Veteran Member
Posts:1207
Avatar

--
24 Feb 2006 11:00 AM  
I think the only way around this is to provide two columns, one with the value and one with the link and the users can click on the value column to sort by that value. Or, you could provide both in the same column, but contenate the value onto the front of the link so that is the value used primarily in the sorting. Ex. Richard Edwards View In this case, you provide a user name and then a link that says View instead of the name.


Richard Edwards
DNNStuff Founder
Did you receive excellent support? Consider leaving a testimonial
Jeff Bishop
New Member
New Member
Posts:2

--
24 Feb 2006 12:59 PM  
I see... one thing that might be usefull in a later version would be to allow the grid to be sorted by a column that is not in the query... so it would look at the query and what you have entered into the "order by" text box and then it would sort baised on that column name... -Kev
You are not authorized to post a reply.

Active Forums 4.1
Privacy StatementTerms Of UseCopyright (c) 2004-2012 DNNStuff