Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Nedeľa, 8. december 2024
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Making Links from 2 Fields

phpMyEdit Configuration     Making Links from 2 Fields
Odoslať novú tému   Odpovedať na tému   Choď na stránku 1, 2  Ďalší  
 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2009-08-02 19:19
Návrat hore  Odpovedať s citátom     

I am trying to create a field that uses the information from that cell and another in my table, and I would appreciate any help I can get. I know I'll have to use mysql concat, but I'm not sure how to create the link from two fields.

Here's what I am looking for. The link would be like http://example.com/field1%20field2. I would like the text in the cell (field2) to be linked.

Does anyone know how to do this? Thanks a bunch.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-08-05 13:29
Návrat hore  Odpovedať s citátom     

Try something along the lines of
Kód:
$opts['fdd']['email']['sql|LF'] =
   'if(email <> "",
      CONCAT("<a href=\"mailto:", email,
         "?subject=Hello&body=Merry%20Christmas,
           Bill\">",
             yourOtherColumn,
                "</a>"),
                  "")';


 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2009-12-16 04:21
Návrat hore  Odpovedať s citátom     

Doug,

I've almost got this working, but the second (and third) fields aren't being pulled from the database. My columns are number and subject, and the link includes both the subject and the number, and I need the link text to be the number. So:

Kód:
$opts['fdd']['number'] = array(
  'escape'   => false,
  'name'     => 'Number',
);

$opts['fdd']['number']['sql|VLF'] =
'if(number <> "",
CONCAT("<a href=\"http://bulletin.uga.edu/Link.aspx?cid=,
subject,
%20",
number,
"\" target=\"_blank\">,
number,
</a>"),
"")';


The subject and the second number aren't pulling from the database. The link should ultimately be
Kód:
<a href="http://bulletin.uga.edu/Link.aspx?subject%20number" target="_blank">number</a>
Any ideas?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2009-12-16 04:55
Návrat hore  Odpovedať s citátom     

Quoting with " should be more like this;
Kód:
CONCAT("<a href=\"http://bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),


 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2009-12-16 05:42
Návrat hore  Odpovedať s citátom     

Doug,

That's exactly what I was looking for and it works great. Thank you so much.

This is amazing, that phpMyEdit can do this much.

Did you happen to see my question about links to records?

http://opensource.platon.sk/forum/projects/viewtopic.php?t=828533

Thanks again!

Chris

 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2010-01-07 20:11
Návrat hore  Odpovedať s citátom     

Doug,

I recently discovered an issue with the code you suggested. While using the sql query to make the links, I can no longer filter using the 'number' column.

The code I'm using is:
Kód:
$opts['fdd']['number'] = array(
  'select'   => 'D',
  'escape'   => false,
  'name'     => 'Number',
);

$opts['fdd']['number']['sql|VLF'] =
'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")';


When I select a value from the drop down and hit 'Filter', no rows are shown on the next page.

If I take out that sql query, bam, I can filter again. Put it back in, and the filtering by 'number' returns no results.

Any idea what the issue is? I feel like I am missing a simple option here, but I've changed quite a bit and can't manage to get this to work.

Thanks for your help.

 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2010-01-08 04:59
Návrat hore  Odpovedať s citátom     

Anyone have a clue?

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-01-09 15:41
Návrat hore  Odpovedať s citátom     

Perhaps the link can be incorporated in a new virtual (dummy) field which is displayed in addition to the original field array. A new field similar in structure to this:

Kód:
$opts['fdd']['dummy1'] = array (
   'input'   => 'R',
   'name'    => 'Whois',
   'sql'     => 'CONCAT("<a href=\"http://whois.domaintools.com/", domain, "\" target=\"_blank\">whois</a>")',
   'options' => 'VFL',
   'escape'  => false,
   'sort'    => true
);


 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2010-01-10 05:46
Návrat hore  Odpovedať s citátom     

Doug,

Thanks for getting back to me. I've tried to use this code two different ways, but neither is showing the records on the filter with the sql field.

Kód:
$opts['fdd']['number'] = array(
  'select'   => 'D',
  'escape'   => false,
  'name'     => 'Number',
  'sort'     => true
);

$opts['fdd']['number']['sql|VLF'] =
'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")';

$opts['fdd']['number'] = array (
   'input'   => 'R',
  'select'   => 'D',
   'name'    => 'Number',
   'sql'     =>  'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")',
   'options' => 'VFL',
   'escape'  => false,
   'sort'    => true
);


And:

Kód:
$opts['fdd']['number'] = array(
  'select'   => 'D',
  'escape'   => false,
  'name'     => 'Number',
  'sort'     => true
);

$opts['fdd']['number'] = array (
   'input'   => 'R',
  'select'   => 'D',
   'name'    => 'Number',
   'sql'     =>  'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")',
   'options' => 'VFL',
   'escape'  => false,
   'sort'    => true
);


Can you spot any error? I really appreciate your help.

 
doug     Založený: 10.02.2003   Príspevky: 1013   Bydlisko: Denver, Colorado (USA)
Príspevok Zaslal: 2010-01-10 05:56
Návrat hore  Odpovedať s citátom     

Kód:
// recreate a standard / default `number` field here

// create dummy / virtual field approximately like this

$opts['fdd']['dummy1'] = array (
   'input'   => 'R',
   'name'    => 'Whois',
   'sql'     =>  'if(number <> "", CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"), "")',
   'options' => 'VFL',
   'escape'  => false,
   'sort'    => true
);


 
clindsey     Založený: 01.09.2008   Príspevky: 31  
Príspevok Zaslal: 2010-01-10 06:10
Návrat hore  Odpovedať s citátom     

Doug,

I'm trying this and it still isn't letting me filter with that field. Just to make sure we are talking about the same thing, originally, my non-filtering code was this:

Kód:
$opts['fdd']['number'] = array(
  'select'   => 'D',
  'escape'   => false,
  'name'     => 'Number',
  'sort'     => true
);

$opts['fdd']['number']['sql|VLF'] =
'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")';


The code you've put here that I've tried and doesn't filter properly is this:

Kód:
$opts['fdd']['number'] = array(
  'select'   => 'D',
  'escape'   => false,
  'name'     => 'Number',
  'sort'     => true
);

$opts['fdd']['number']['sql|VLF'] =
'if(number <> "",
CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"),
"")';

$opts['fdd']['number'] = array (
   'input'   => 'R',
  'select'   => 'D',
   'name'    => 'Number',
   'sql'     =>  'if(number <> "", CONCAT("<a href=\"http://ugakey.com/description.php#bulletin.uga.edu/Link.aspx?cid=", subject, "%20", number, "\" target=\"_blank\">", number, "</a>"), "")',
   'options' => 'VFL',
   'escape'  => false,
   'sort'    => true
);


Thanks again for your continued help.

 
ceqen     Založený: 18.01.2021   Príspevky: 1  
Príspevok Zaslal: 2021-01-18 07:03
Návrat hore  Odpovedať s citátom     

I was looking for the same error resolution and I got it on a blog. If you really want to take help regarding your error then dissertation writing service can help you in this and here you will get knowledge of other different functions.

 
Arlo Jasper     Založený: 10.03.2021   Príspevky: 1  
Príspevok Zaslal: 2021-03-10 17:00
Návrat hore  Odpovedať s citátom     

if you are facing any trouble then simply just visit this site https://www.essaysnassignments.co.uk/ , you will find lot of help for sure .

 
oliverjake     Založený: 24.09.2021   Príspevky: 8  
Príspevok Zaslal: 2021-10-21 16:07
Návrat hore  Odpovedať s citátom     

This is really interesting, You&#8217;re a very skilled blogger. Thanks for sharing your thoughts Dissertation Writing Services UK

 
stevemarkinson     Založený: 04.09.2021   Príspevky: 4  
Príspevok Zaslal: 2021-12-10 08:22
Návrat hore  Odpovedať s citátom     

Want to take assignment help ? then you can end your search here. We provide assignment help services to students and professionals in Kuwait at the best price. You can take more information about us by going to our website.

 
Odoslať novú tému   Odpovedať na tému   Choď na stránku 1, 2  Ďalší  

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov