Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Saturday, July 13, 2024
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  How to use URL from one column to link in another column?

phpMyEdit Features     How to use URL from one column to link in another column?
Post new topic   Reply to topic    
 
glenleslie     Joined: 10 Nov 2009   Posts: 5  
Post Posted: 2011-08-28 07:05
Back to top  Reply with quote     

If my database has the following columns

ID, Title, URL_for_Title

1, "Fast and furious", "http://imdb.com/movies/fnf.html"
2, Bambi, http://disneystory.com/bambi.html


How do I get URL_for_Title to link for the column "Title"?

I just want "Fast and Furious" and "Bambi" to be linked in the display.

Thanks for pointers.

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2011-08-29 17:22
Back to top  Reply with quote     

Search the forum for CONCAT in order to locate examples of creating custom links. Consider creating a virtual / dummy field.
Code:
$opts['fdd']['dummy2'] = array (
   'name' => 'Thumbnail',
   'sql|VLF' => 'if(category = "other",
      CONCAT("<a href=\"", dir, "/", filename, "\" target=\"_blank\">link</a>"),
         if(category = "thumb", CONCAT("<a rel=\"example_group\" href=\"", REPLACE(dir, "/tn", "/"), filename, "\" target=\"_blank\"><img src=\"", dir, "/", filename, "\" ", " alt=\"\" border=\"0\"></a><br><a href=\"fancybox.change.php?upld_id=", upld_id, "\">Replace</a>"), ""))',
   'options'  => 'VLF',
   'input'  => 'R',
   'escape' => false,
   'sort'     => false
);


 
glenleslie     Joined: 10 Nov 2009   Posts: 5  
Post Posted: 2011-09-05 18:35
Back to top  Reply with quote     

Somehow I'm missing the basic syntax of the quoting.

this statement:

Code:
$opts['fdd']['dummy1'] = array(
   'name' => 'lnk',
   'sql' => 'CONCAT("<a href=\", URL, \">, Title, </a>")',
   'options' => 'VLF',
   'input' => 'R',
   'escape' => 'false',
   'sort' => 'true'
   );


yields these results in the web page display:

<a href=", URL, ">, Title, </a>

(problem: instead of replacing URL and Title with their values from the database, they are just treated as plain text). Not sure where I went wrong there.

troubleshooting attempts:
1. using no quotes around then entire <a href="" </a>, I get a syntax error back from mysql.
Code:
'sql' => 'CONCAT(<a href=\"', URL, '\">', Title, '</a>)',

2. tried single quotes within the parens on the CONCAT - mysql error.
Code:
'sql' => 'CONCAT('<a href=\", URL, \">, Title, </a>')',


3. tried single quoting each value which is text in the ConCat (per mySQL reference for CONCAT). mysql error.
Code:
'sql' => 'CONCAT('<a href=\"', URL, '\">', Title, '</a>')',


4. using no href and just concatenating the values URL and Title, i get the proper values back.

Anyway, please send me to RTFM if I really haven't studied either the manual or the examples closely enough. Have tried it a couple of days without success for this simple task.

TIA

 
glenleslie     Joined: 10 Nov 2009   Posts: 5  
Post Posted: 2011-09-10 03:53
Back to top  Reply with quote     

finally got it... seems like it would be good to add a complete example like this to the documentation...

Code:
$opts['fdd']['linkedfield'] = array(
  'name'     => 'Titles',
  'URL' => true,
   'URLtarget' => '_blank',
  'sql|VLF' => 'CONCAT("<a href=\"",LINKURL,"\">",Title,"</a>")',
  'options'   => 'VLF',
  'escape' => false,
  'input' => 'R',
  'sort'     => true
);


It also seems like URLdisp command would take care of all of the trouble here if it could just point out another column in the record (you already provide a variable for the key ($key) of the record why not a $column[<name>]... maybe there's a way to do that with a cgi or php variable and I'm just not seeing it...

p.s. this approach is also messy when you look at the resulting HTML code-- by invokig the URL command you already create an href in your html output but then this "outer" href link is dummied to "1" then the concat method creates another href within the href... seems really messy... ?

l8r

 
doug     Joined: 10 Feb 2003   Posts: 1013   Location: Denver, Colorado (USA)
Post Posted: 2011-09-10 15:33
Back to top  Reply with quote     

The CONCAT method is intended for cases when you need to pass multiple columns in the link, or in the link text, which is what I (mistakenly) thought was the goal. If you only need to pass one column then stick to the documented URL feature.

Code:
$opts['fdd']['linkedfield'] = array(
  'name'     => 'Titles',
  'sql|VLF' => 'CONCAT("<a href=\"",LINKURL," target=\"_blank\"\">",Title," - ",SomeOtherField,"</a>")',
  'options'   => 'VLF',
  'escape' => false,
  'input' => 'R',
  'sort'     => true
);



Last edited by doug on 2011-09-10 15:38, edited 1 time in total

 
Damon576     Joined: 25 Aug 2020   Posts: 3  
Post Posted: 2020-09-25 07:28
Back to top  Reply with quote     

Simply use the code to link both of them and you can easily configure it and use it properly. The best essay writing service review already shares the code and create a video for students for better learning.

 
yousuf     Joined: 16 Sep 2021   Posts: 92  
Post Posted: 2021-11-14 11:10
Back to top  Reply with quote     

I would also love to add that when you do not currently have an insurance policy or maybe you do not take part in any group insurance, you might well make use of seeking the aid of a health insurance broker. Self-employed or people who have medical conditions generally seek the help of any health insurance broker. Thanks for your blog post. best place to buy followers on instagram

 
geekstation     Joined: 13 Sep 2021   Posts: 2409  
Post Posted: 2022-01-25 01:29
Back to top  Reply with quote     

This specific is a great article My spouse and i witnessed due to talk about the idea. It is definitely precisely what I want to to view expect throughout potential you can proceed pertaining to expressing a real exceptional article. Packers and Movers Coimbatore

 
radley112     Joined: 04 May 2022   Posts: 1  
Post Posted: 2022-05-04 18:18
Back to top  Reply with quote     

I'll recommend a fun game to pass the time. Slope unblocked is a 3D design with green lines indicating the bounds for each object. When I initially started playing it, I thought it had a pretty retro look to it, similar to what we used to see on computers.

 
denisbeta     Joined: 25 Aug 2023   Posts: 2154  
Post Posted: 2023-08-28 22:23
Back to top  Reply with quote     

https://market.50discount-sale.com/AvikeC/
https://twitter.com/denisyakovlev68/status/1694332003385049496

https://market.50discount-sale.com/wvpY5O/
https://twitter.com/denisyakovlev68/status/1694317650384421243

https://market.50discount-sale.com/59VCH7/?PageSpeed=off&channel=59VCH7&click=710117338&lang=bs
https://market.50discount-sale.com/59VCH7/?PageSpeed=off&channel=59VCH7&click=710117338&lang=hr
https://market.50discount-sale.com/59VCH7/?PageSpeed=off&channel=59VCH7&click=710117338&lang=mk
https://market.50discount-sale.com/59VCH7/?PageSpeed=off&channel=59VCH7&click=710117338&lang=sq

http://a4.bing.com/images/search?q=site:euro-shop.store
http://a4.bing.com/images/search?q=site:thai-shop.store
http://a4.bing.com/images/search?q=site:rocket.denisyakovlev.moscow
http://a4.bing.com/images/search?q=site:ev.nickyfora.ru
http://a4.bing.com/images/search?q=site:denisyakovlev.ru
http://a4.bing.com/images/search?q=site:denisyakovlev.com

http://a4.bing.com/images/search?q=site:bloghealthy.press
http://a4.bing.com/images/search?q=site:bloghealthy.asia
http://a4.bing.com/images/search?q=site:topbestgoods.press
http://a4.bing.com/images/search?q=site:beautybesthealth.asia
https://twitter.com/denisyakovlev68/status/1694299374354915812


http://go.billion-online.ru/page/91c5399d456b7da4523a37b0bf212d9ce8527246/
https://twitter.com/denisyakovlev68/status/1694093548742717872
http://go.billion-online.ru/page/6622abc916503de2f803a4d15b94c4b0f9ef26e5/
https://twitter.com/denisyakovlev68/status/1694094384541626753

https://market.50discount-sale.com/3kZmjS/
https://blog.seo.denisyakovlev.ru/2023/08/20.html

https://market.50discount-sale.com/Jna8vF/
https://twitter.com/denisyakovlev68/status/1694000353254224067

http://go.billion-online.ru/page/709ef5c11cfdd0525447a9f50f78e656198b25c7/
https://twitter.com/denisyakovlev68/status/1693909889632837683
http://go.billion-online.ru/page/4d298f2b758f6af8abf35bb60ab5e8525d0cf202/
https://twitter.com/denisyakovlev68/status/1693910924334080235

https://medium.com/@denisyakovlev.com
http://lifestream.denisyakovlev.ru/2023/08/blog-post.html
https://twitter.com/denisyakovlev68/status/1693481964047675487

https://thai-shop.store/meta/black-rhino/th/truth/
https://twitter.com/denisyakovlev68/status/1693276731291955392

https://blog.seo.denisyakovlev.ru/2023/08/wildberries.html
https://twitter.com/denisyakovlev68/status/1693267718672154636

https://www.segwayninebot.ru/club/user/14776/
http://www.bloghotel.org/denisyakovlev/

http://bit.ly/m/denis
https://twitter.com/denisyakovlev68/status/1693351404146934061




http://news-ro-canabilab.euro-shop.store
http://ro-canabilab.euro-shop.store
https://twitter.com/denisyakovlev68/status/1692967315795546370
https://twitter.com/denisyakovlev68/status/1692967641151840442

Nomidol indonesia
http://nomidol-id.ev.nickyfora.ru
http://nomidol-id-pr.ev.nickyfora.ru

http://nomidol-id21.ev.nickyfora.ru
http://nomidol-id21pr.ev.nickyfora.ru

http://med-id-nomidols.ev.nickyfora.ru
http://id3-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692980113430712377
https://twitter.com/denisyakovlev68/status/1692980370331849067

http://med2-id-nomidols.ev.nickyfora.ru
http://id4-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692987260642197712
https://twitter.com/denisyakovlev68/status/1692987550879584432

http://blog1-id-nomidols.ev.nickyfora.ru
http://id5-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692988685346566317
https://twitter.com/denisyakovlev68/status/1692989004113719486

http://id7-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692990481800573182
http://id8-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692992882674704458

http://id12-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692994395388157964

http://id17-nomidols.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692995471738823078

http://blog-id-dialine.ev.nickyfora.ru
http://2-id-dialine.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1692998060077453337
https://twitter.com/denisyakovlev68/status/1692998383135342655

http://3-blog-id-dialine.ev.nickyfora.ru
http://3-id-dialine.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693000512562422226
https://twitter.com/denisyakovlev68/status/1693000765210567000

http://8-id-dialine.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693014702954041477

http://2-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693016528138952947
http://3-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693017277405298795
http://4-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693019374473421272
http://5-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693020026448621730
http://6-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693021174580625442
http://8-id-stop-active.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693021971829719114

http://2-id-whitequeen-skin.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693024750119862423
http://3-id-whitequeen-skin.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693025887447314943
http://4-id-whitequeen-skin.ev.nickyfora.ru
https://twitter.com/denisyakovlev68/status/1693027498139816195

http://prodvizenie68.ru
http://portal.prodvizenie68.ru
http://portal.prodvizenie68.ru/blog/
http://portal.prodvizenie68.ru/blog/prodvizhenie_molodezhnogo_internet_portala/2023-08-20-1
https://twitter.com/denisyakovlev68/status/1693193063127015471

https://beautybesthealth.asia/meta/black-rhino/th/v6/?geo=34461&flow_id=kfcdkay3gu&click_id=OdCCrrSGaC&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4&sub5=sub5&facebook=&pl=&lp=10233
https://twitter.com/denisyakovlev68/status/1693223343191638396
https://twitter.com/denisyakovlev68/status/1693223854447988967

https://megalodon.jp/ref/2023-0821-0547-16/https://thai-shop.store:443/
https://blog.seo.denisyakovlev.ru/p/blog-page_20.html
https://twitter.com/denisyakovlev68/status/1693367588842086821
https://blog.seo.denisyakovlev.ru/2023/08/blog-post_20.html
https://twitter.com/denisyakovlev68/status/1693370668023214113
https://blog.seo.denisyakovlev.ru/p/blog-page_66.html
https://twitter.com/denisyakovlev68/status/1693373424146522615


https://denisyakovlev.ru/flirt2.html
https://goodhistoryhealth.com/hairex2/pe/mundo/?click_hash=bKAtHDHOou&flow_hash=6qrfo2ly6c&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4&sub5=sub5&facebook=&pl=7446
https://goods-besttop.com/hairex2/pe/v1/?geo=111143&flow_id=6qrfo2ly6c&click_id=bKAtHDHOou&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4&sub5=sub5&facebook=&pl=7446&lp=10253
https://goods-besttop.com/hairex2/pe/v2/?geo=111143&flow_id=so3mgx648o&click_id=u3AAvbDhce&sub1=sub1&sub2=sub2&sub3=sub3&sub4=sub4&sub5=sub5&facebook=&pl=&lp=10254

http://a4.bing.com/images/search?q=site:goodhistoryhealth.com
http://a4.bing.com/images/search?q=site:goods-besttop.com

http://drrank.ir/thai-shop.store

111

 
MILLER     Joined: 02 Oct 2023   Posts: 170  
Post Posted: 2023-10-02 14:59
Back to top  Reply with quote     

Out of all the articles I've read, yours is the most insightful. I can tell you're passionate about this. domiciliation tanger

 
parkerr     Joined: 03 Oct 2023   Posts: 96  
Post Posted: 2023-10-03 18:22
Back to top  Reply with quote     

Your ability to weave complex thoughts into simple words is nothing short of amazing. Thank you! domiciliation tanger

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy