• Eagle Eyes

    From Spectre@21:3/105 to Alterego on Saturday, September 07, 2019 14:41:00
    Ok Eagle Eye,

    This one has me stumped too...

    $raw_results = mysql_query("SELECT * FROM list
    WHERE (`%".$field."%'.` LIKE '%".$query."%'") or die(mysql_error());

    Which throws an error,

    You have an error in your SQL syntax; check the manual that corresponds to your
    MySQL server version for the right syntax to use near '' at line 2



    Spec


    --- --- SuperBBS v1.17-3 (Eval)
    * Origin: <Shoot'n the breeze on The Lower Planes> (21:3/105)
  • From Spectre@21:3/105 to Alterego on Saturday, September 07, 2019 21:47:00
    This probably should be $raw_results = mysql_query("SELECT
    * FROM LIST WHERE ".$field." LIKE '%".$query."%'") or

    Ta, I'll give it a belt. It got tricky when I started to add a variable as the
    field to search on. PHP seems to be a rats nest of brackets and quotes to me.

    Spec


    --- --- SuperBBS v1.17-3 (Eval)
    * Origin: <Shoot'n the breeze on The Lower Planes> (21:3/105)