
Jason
Staff
/ Moderator

Jan 18, 2012, 10:45 AM
Post #3 of 3
(366 views)
Shortcut
|
Hi, The easiest way to do this is to create an array that has the service's record num as an index and the services title as a value. You can then output a service title by using the number returned by your query as an index. This example assumes that you are using CMS Builder version 2.08 or higher:
$allServices = mysql_select("vendor_services"); $serviceNumToTitle = array_combine(array_pluck($allServices, 'num'), array_pluck($allServices, 'title')); You should then be able to output a service's title like this:
<?php echo $servicesNumToTitle[$Driver['service']]; ?> Hope this helps --------------------------------------------------- Jason Sauchuk - Programmer interactivetools.com Hire me! Save time by getting our experts to help with your project. http://www.interactivetools.com/consulting/
|