ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

MYSQL request problem

October 18, 2013 9:35am

Subscribe [1]
  • #1 / Oct 18, 2013 9:35am

    fimor

    3 posts

    Hi,
    When I use this MYSQL request:

    function get_adverts_info($title)
     {
                    $query = $this->db->query('
                                                SELECT  *  FROM categories_a 
                                                LEFT JOIN adverts ON (categories_a.id = adverts.id_categories_a)
                                                WHERE adverts.url LIKE '.$title.' 
                                                 
                                            ');
                    return $query->row_array();              
     }

    CI gives me the follow message:
    Error Number: 1054

    Unknown column ‘ur’ in ‘where clause’

    SELECT * FROM categories_a LEFT JOIN adverts ON (categories_a.id = adverts.id_categories_a) WHERE adverts.url LIKE ur

    Filename: Z:\home\localhost\www\budprice\system\database\DB_driver.php

    Line Number: 330

    What’s wrong? As I understand the problem is with quotes ‘ur’. How to write correctly ?
    Thanks!

  • #2 / Oct 18, 2013 10:23am

    fimor

    3 posts

    I found solution

    LIKE "'.$title.'"
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases