Welcome Guest, Not a member yet? Register   Sign In
No like in getResultArray
#6

(This post was last modified: 08-09-2018, 09:40 AM by John_Betong. Edit Reason: Mentioned missing images )

Try this because it works for me:
PHP Code:
 $db = \Config\Database::connect();

 
 $tmp $data['title'];
 
 
  $sql 
= <<< ____TMP
    SELECT
      `xrl`, `title`, `memo`
    FROM 
      `jokes`
    WHERE
      `xrl` 
    LIKE
      "%
$tmp%"      
____TMP;

 
 $query   $db->query$sql );
 
 $data['items'] = $query->getResultArray(); 
Online demo:

// list of jokes
  https://johns-jokes.cf/home?app=4

// select any joke title from above
// images have yet to be displayed because URLs in database and link to another domain
Reply


Messages In This Thread
No like in getResultArray - by Nome - 08-08-2018, 02:00 PM
RE: No like in getResultArray - by John_Betong - 08-08-2018, 11:18 PM
RE: No like in getResultArray - by Nome - 08-09-2018, 01:58 AM
RE: No like in getResultArray - by John_Betong - 08-09-2018, 02:09 AM
RE: No like in getResultArray - by Nome - 08-09-2018, 03:05 AM
RE: No like in getResultArray - by John_Betong - 08-09-2018, 08:40 AM
RE: No like in getResultArray - by Nome - 08-09-2018, 11:54 AM
RE: No like in getResultArray - by John_Betong - 08-09-2018, 11:33 PM
RE: No like in getResultArray - by puschie - 08-10-2018, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB