Article View: pl.comp.lang.php
Article #231373dziwne wyniki zapytania SQL
From: jivanmukta
Date: Fri, 08 Jul 2016 06:44
Date: Fri, 08 Jul 2016 06:44
51 lines
5912 bytes
5912 bytes
Zapytanie SQL z poziomu PHP zwraca mi co innego niż to samo zapytanie z poziomu klienta mysql. Proszę zwrócić uwagę na wartość kolumny use_rooms ('-' z mysql oraz '' z PHP). Poniżej wybrałem jeden wiersz z wyników.
mysql> SELECT estate_type_id, use_region, use_town, use_district, use_address, use_floor_no, use_floors, use_area, use_rooms, use_offices, use_year_built, use_ownership, use_standard, use_house, use_buildings, use_garrage, use_parking, use_kitchen, use_balcony, use_gas, use_current, use_sewerage, use_furniture_type, use_equipment, use_guard, use_pictures, use_remarks FROM estate_types_visibility INNER JOIN estate_types USING(estate_type_id) ORDER BY estate_type_name ASC;
+----------------+------------+----------+--------------+-------------+--------------+------------+----------+-----------+-------------+----------------+---------------+--------------+-----------+---------------+-------------+-------------+-------------+-------------+---------+-------------+--------------+--------------------+---------------+-----------+--------------+-------------+
| estate_type_id | use_region | use_town | use_district | use_address | use_floor_no | use_floors | use_area | use_rooms | use_offices | use_year_built | use_ownership | use_standard | use_house | use_buildings | use_garrage | use_parking | use_kitchen | use_balcony | use_gas | use_current | use_sewerage | use_furniture_type | use_equipment | use_guard | use_pictures | use_remarks |
+----------------+------------+----------+--------------+-------------+--------------+------------+----------+-----------+-------------+----------------+---------------+--------------+-----------+---------------+-------------+-------------+-------------+-------------+---------+-------------+--------------+--------------------+---------------+-----------+--------------+-------------+
| DZI | + | + | + | + | - | - | + | - | - | + | + | + | + | + | 0 | + | + | - | + | + | + | - | + | + | + | + |
+----------------+------------+----------+--------------+-------------+--------------+------------+----------+-----------+-------------+----------------+---------------+--------------+-----------+---------------+-------------+-------------+-------------+-------------+---------+-------------+--------------+--------------------+---------------+-----------+--------------+-------------+
public function getEstateTypesVisibility() {
$sql = 'SELECT estate_type_id, use_region, use_town, use_district, use_address, use_floor_no, use_floors, use_area, use_rooms, use_offices, use_year_built, use_ownership, use_standard, use_house, use_buildings, use_garrage, use_parking, use_kitchen, use_balcony, use_gas, use_current, use_sewerage, use_furniture_type, use_equipment, use_guard, use_pictures, use_remarks ' .
'FROM estate_types_visibility INNER JOIN estate_types USING(estate_type_id) ' .
'ORDER BY estate_type_name ASC';
var_dump($sql);
$rec = $this->db->query($sql)->result_array();
var_dump($rec);
return $rec;
}
11 =>
array (size=27)
'estate_type_id' => string 'DZI' (length=3)
'use_region' => string '+' (length=1)
'use_town' => string '+' (length=1)
'use_district' => string '+' (length=1)
'use_address' => string '+' (length=1)
'use_floor_no' => string '-' (length=1)
'use_floors' => string '-' (length=1)
'use_area' => string '+' (length=1)
'use_rooms' => string '' (length=0)
'use_offices' => string '+' (length=1)
'use_year_built' => string '+' (length=1)
'use_ownership' => string '+' (length=1)
'use_standard' => string '+' (length=1)
'use_house' => string '+' (length=1)
'use_buildings' => string '+' (length=1)
'use_garrage' => string '0' (length=1)
'use_parking' => string '+' (length=1)
'use_kitchen' => string '+' (length=1)
'use_balcony' => string '-' (length=1)
'use_gas' => string '+' (length=1)
'use_current' => string '+' (length=1)
'use_sewerage' => string '+' (length=1)
'use_furniture_type' => string '-' (length=1)
'use_equipment' => string '+' (length=1)
'use_guard' => string '+' (length=1)
'use_pictures' => string '+' (length=1)
'use_remarks' => string '+' (length=1)
Czy ktoś umie to wytłumaczyć? Byłbym wdzięczny za pomoc.
Technical Details
Message-ID:
<1ee1eacf-a3bc-4626-bac3-53f8af2dd405@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f89no3346346qtd.0!news-out.google.com!o189ni5811ith.0!nntp.google.com!r1no13702752ige.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mailShow Full Headers
Complete Article Headers
X-Received: by 10.237.35.123 with SMTP id i56mr3676190qtc.16.1467960284759; Thu, 07 Jul 2016 23:44:44 -0700 (PDT) X-Received: by 10.36.64.133 with SMTP id n127mr52923ita.4.1467960284494; Thu, 07 Jul 2016 23:44:44 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!peer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!f89no3346346qtd.0!news-out.google.com!o189ni5811ith.0!nntp.google.com!r1no13702752ige.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: pl.comp.lang.php Date: Thu, 7 Jul 2016 23:44:43 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=83.28.42.232; posting-account=Y8V58QoAAACtLuF8lEt8MaiUjYUTCWP6 NNTP-Posting-Host: 83.28.42.232 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1ee1eacf-a3bc-4626-bac3-53f8af2dd405@googlegroups.com> Subject: dziwne wyniki zapytania SQL From: jivanmukta@poczta.onet.pl Injection-Date: Fri, 08 Jul 2016 06:44:44 +0000 X-Received-Bytes: 5948 X-Received-Body-CRC: 4084651814 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit