Server
Debian 4.9.65-3+deb9u1 (2017-12-23) x86_64 Mysql 5.7 PHP 7.2 Table in database
CREATE TABLE `test` ( `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, `user` INT(11) NULL DEFAULT NULL, `project` INT(11) NULL DEFAULT NULL, `text` TEXT NULL COLLATE 'utf8_general_ci', PRIMARY KEY (`id`) ) COLLATE='utf8_unicode_ci' ENGINE=InnoDB AUTO_INCREMENT=2; PHP script
<?php $mysqli = new mysqli('localhost','****','****','***'); $product_name = $mysqli->query("SELECT * FROM test WHERE id = 1")->fetch_object(); var_dump($product_name); $mysqli->close(); Server response
object(stdClass)#3 (4) { ["id"]=> string(1) "1" ["user"]=> string(1) "1" ["project"]=> string(1) "2" ["text"]=> string(10) "Текст" }
through PDO, also all in string
Ie always get a string, can I put some kind of module? I put everything from standard repositories and default settings. Timeweb hosting
PHP, why do you need specific types?) PSstring- from mysql - this is normal behavior. - Manitikyl