Advertisement
Guest User

Untitled

a guest
Oct 20th, 2011
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 1.85 KB | None | 0 0
  1. SELECT
  2.                @rownum := @rownum + 1 rownum,
  3.                tour_foreign.id,
  4.                tour_foreign.name,
  5.                tour_foreign.airline,
  6.                MIN(tour_foreign_residence.name_re) AS name_re,
  7.                tour_foreign.service,
  8.                tour_foreign.date_go,
  9.                tour_foreign.date_back,
  10.                tour_foreign.term,
  11.                tour_foreign.useradmin_submit,
  12.                tour_foreign.date_submit,
  13.                GROUP_CONCAT( tour_foreign_residence.name_re
  14.                      ORDER BY tour_foreign_residence.name_re
  15.                      SEPARATOR "، "
  16.                    ) AS name_re_all
  17.             FROM   tour_foreign
  18.               INNER JOIN tour_foreign_residence
  19.             ON ( tour_foreign.id = tour_foreign_residence.relation )
  20.               JOIN (SELECT @rownum := 0) r
  21.             WHERE  tour_foreign.name LIKE "%' . $find . '%" OR
  22.             WHERE FIND_IN_SET("%' . $find . '%", name_re_all);
  23.             GROUP BY  tour_foreign.id'
  24.  
  25.  
  26.  
  27. I get this error:
  28.  
  29. A Database Error Occurred
  30. Error Number: 1064
  31.  
  32. 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 'WHERE FIND_IN_SET("%%", name_re_all); GROUP BY tour_foreign.id' at line 22
  33.  
  34. SELECT @rownum := @rownum + 1 rownum, tour_foreign.id, tour_foreign.name, tour_foreign.airline, MIN(tour_foreign_residence.name_re) AS name_re, tour_foreign.service, tour_foreign.date_go, tour_foreign.date_back, tour_foreign.term, tour_foreign.useradmin_submit, tour_foreign.date_submit, GROUP_CONCAT( tour_foreign_residence.name_re ORDER BY tour_foreign_residence.name_re SEPARATOR "، " ) AS name_re_all FROM tour_foreign INNER JOIN tour_foreign_residence ON ( tour_foreign.id = tour_foreign_residence.relation ) JOIN (SELECT @rownum := 0) r WHERE tour_foreign.name LIKE "%%" OR WHERE FIND_IN_SET("%%", name_re_all); GROUP BY tour_foreign.id
  35.  
  36. Filename: D:\xampp\htdocs\system\database\DB_driver.php
  37.  
  38. Line Number: 330
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement