I have this simple code that works fine:
$sQuery = $this->db->query("SELECT domain FROM domainmarket.inventory_domains");
but when i use this
$sQuery = $this->db->query("SELECT
invDom.domain,
sldPhr.phrase1
FROM domainmarket.inventory_domains invDom
INNER JOIN lux.domain_info domInfo
ON invDom.domain = domInfo.domain
JOIN lux.sld_stats sldStats
ON domInfo.sld = sldStats.sld
JOIN lux.sld_phrase sldPhr
ON sldPhr.sld = sldStats.sld");
or this
$sQuery = $this->db->query("SELECT
invDom.domain,
sldPhr.phrase1
FROM domainmarket.inventory_domains invDom
INNER JOIN lux.domain_info domInfo
ON invDom.domain = domInfo.domain
JOIN lux.sld_stats sldStats
ON domInfo.sld = sldStats.sld
JOIN lux.sld_phrase sldPhr
ON sldPhr.sld = sldStats.sld
WHERE SOUNDEX(SUBSTRING_INDEX(invDom.domain, ".", 1)) = SOUNDEX('love')
ORDER BY invDom.appraised_price DESC");
it already gives this error:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to
allocate 32 bytes) in
C:\xampp\htdocs\ci_test\system\database\drivers\mysql\mysql_result.php
on line 152
or
Error Number: 1064
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 ‘ 1) ) = SOUNDEX(‘love’) ORDER BY invDom.app’ at line 5
SELECT invDom.domain, sldPhr.phrase1 FROM domainmarket.inventory_domains invDom INNER JOIN lux.domain_info
domInfo
ON invDom.domain = domInfo.domain JOIN lux.sld_stats sldStats
ON domInfo.sld = sldStats.sld JOIN lux.sld_phrase sldPhr
ON sldPhr.sld sldStats.sld WHERE SOUNDEX(SUBSTRING_INDEX(invDom.domain,, 1)) = SOUNDEX(‘love’) ORDER
BY invDom.appraised_price DESC Filename:
C:\xampp\htdocs\ci_test\system\database\DB_driver.php Line Number:
33
respectively. Both of these codes work fine in heidiSQL though.. why am i getting this error in codeigniter?
It’s a quoting issue. You wrap your query in
"and then use them in your query.