Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL query works in phpmyadmin but not through php
    text
    copied!<p>Any ideas would help, I have been on this for a while now and just can't figure out what is wrong.</p> <p>Problem: query works fine until I added in the multiple word search which you can see bolded below. However, I echoed the sql query and then pasted in phpmyadmin and it worked perfectly but through the php it results with 0 records. It doesn't make any sense and I can't figure out what could be causing a result of 0.</p> <pre><code>SELECT DISTINCT c.id FROM carpets AS c INNER JOIN carpet_relations AS r1 ON c.id = r1.carpet_id INNER JOIN carpet_relations AS r2 ON c.id = r2.carpet_id INNER JOIN carpet_relations AS r3 ON c.id = r3.carpet_id WHERE c.active = '1' AND ((c.title LIKE '%north tabriz%') OR **(c.title LIKE '%north%') OR (c.title LIKE '%tabriz%')** OR (c.item_no LIKE '%north tabriz%') OR **(c.item_no LIKE '%north%') OR (c.item_no LIKE '%tabriz%')** OR (c.pattern LIKE '%north tabriz%') OR **(c.pattern LIKE '%north%') OR (c.pattern LIKE '%tabriz%')** OR (c.period LIKE '%north tabriz%') OR **(c.period LIKE '%north%') OR (c.period LIKE '%tabriz%')** OR (c.country LIKE '%north tabriz%') **OR (c.country LIKE '%north%') OR (c.country LIKE '%tabriz%')**) AND (c.width_feet BETWEEN '0' AND '22') AND (c.width_inches BETWEEN '0' AND '11') AND (c.height_feet BETWEEN '0' AND '49') AND (c.height_inches BETWEEN '0' AND '11') ORDER BY c.item_no id int(11) NO PRI NULL auto_increment active int(11) NO NULL title varchar(250) NO NULL item_no varchar(250) NO NULL country varchar(250) NO NULL period varchar(250) NO NULL pattern varchar(250) NO NULL price float NO NULL web_special float NO NULL notes text NO NULL width_feet int(11) NO NULL width_inches int(11) NO NULL height_feet int(11) NO NULL height_inches int(11) NO NULL restrict int(11) NO NULL views_amount int(11) NO NULL last_modified datetime NO NULL modified_by int(11) NO NULL </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload