D
D
Dmitry Kuzmin2016-02-03 17:40:20
PHP
Dmitry Kuzmin, 2016-02-03 17:40:20

Joomla Jdatabase how to fulfill multiple LIKE conditions?

Can't build query in Jdatabase .
There is

$query->select($db->quoteName(array('code_esp', 'short_name', 'full_name', 'region_name', 'zd_name')));
$query->from($db->quoteName('#__rzd_station_name'));
$query->where($db->quoteName('code_esp') . ' LIKE '. $db->quote('%'.$post.'%'));

It is necessary that the value of $post is performed as LIKE on all fields.
An example of such a request:
SELECT * FROM gal_rzd_station_name  WHERE code_esp LIKE '%341%' OR short_name LIKE '%341%'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LittleFatNinja, 2016-02-03
@LittleFatNinja

your base will die))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question