Quick MySQL Lookup

4 posts by 3 authors in: Forums > CMS Builder
Last Post: December 7, 2011   (RSS)


This seems so silly but I can't get my head around it...

I'm using a list field to pull data from a bunch of other records in another table.

In this case the value is the record $num and the label is the record $title - or at least it should be.

In order to make it easier for the user to find the the right record in the list, I'm using the breadcrumb option.

So whenever I return the label of this field, what I actually get is the entire breadcrumb trail : etc : etc!

All I actually need is the record $title.

I think I need to perform some sort of mini mysql look-up which would work something like this:

look-up this table and return the $title which matches this $num

...or something like that.

Can anyone help, please?

:o)

Perch

Re: [Perchpole] Quick MySQL Lookup

Hi Perch,

Don't have any idea if this will help. but I used it to limit the values returned.

You might be able to use the same approach and echo the $title

foreach ($master_subscription_pagesRecords as $record): ?>
<?php if ($record['createdByUserNum']== @$CURRENT_USER['num']): ?>

more code...

Just a thought...

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [Jason] Quick MySQL Lookup

Jason -

Perfect. Exactly what I was looking for.

:0)

Perch

PS. Thanks for chipping in Gerry.