Jump to content

shaydes

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Posts posted by shaydes

  1. I am using this query to get data:


    $cids = "212, 225";
    $query = "select users.id as id, name, convert(text, intro) as intro from users, sections where status=1 and sections.user_id = users.id and users.id in ($cids)";
    $result = mssql_query($query);
    [/Code]

     

    This is the message I get:

    PHP Warning:  mssql_query(): message: Incorrect syntax near ','. (severity 15) in /var/www/msq/select-intro.php on line 495, referer: http://abc.domain.com/select-intro.php.

     

    Before executing the query, the string looks like this:

    select users.id as id, name, convert(text, intro) as intro from users, sections where status=1 and sections.user_id = users.id and users.id in (212, 225)

     

    The comma separated list ($cids) is generated by imploding an array on integers. If I copy the string from debugging output, there is no PHP Warning but if I use $cids, there is.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.