|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-08-14 00:26 UTC] yrob at mail dot crpower dot com
Description:
------------
I'm using MySQL 5.0.1.
The main problem here is that now the mysqli functions don't work. Configuration, make, and make install run just fine. When I try to load a web page, nothing displays (displayed just fine using PHP 5.0.0). When I use the CLI on PHP 5.0.1 to test the web page, it seems to run just fine.
Had to go back to PHP 5.0.0 so my mysqli functions will work.
The other problem is that I wasn't able to get mysql functions to work at all. It wouldn't even pass configuration "--with-mysql=/usr/lib/mysql". Configuration said it couldn't find libmysql, though I pointed it directly to the MySQL 5.0.1 library directory.
Reproduce code:
---------------
$db = new mysqli( 'dbhost', 'username', 'pw');
if (!$db) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); }
$db->select_db("dbname");
$sql = "SELECT * FROM test";
$select = $db->query( $sql );
$result = $select->fetch_array(MYSQLI_BOTH);
$something = $result['something'];
Expected result:
----------------
Loaded web page.
Actual result:
--------------
Web page does not load, but the CLI runs just fine.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 06:00:02 2025 UTC |
PHP crash with "exit signal Segmentation fault (11)" when I try mysqli->query For example this script doesn`t work <?php $db_host = "127.0.0.1"; $db_user = "test"; $db_pass = "test123"; $db_name = "test"; $db = new mysqli($db_host, $db_user, $db_pass, $db_name); $num = $db->query("SELECT uid FROM test WHERE flag = 'TRUE'")->num_rows; echo "$num flags<br>"; $db->close(); echo "ok<br>"; ?> But this script is work <?php $db_host = "127.0.0.1"; $db_user = "test"; $db_pass = "test123"; $db_name = "test"; $db = mysqli_connect($db_host, $db_user, $db_pass, $db_name); $res = mysqli_query($db, "SELECT uid FROM test WHERE flag = 'TRUE'"); $num = mysqli_num_rows($res); echo "$num flags<br>"; echo "ok<br>"; ?> I`m using php 5.0.1, mysql 4.1.3-beta, FreeBSD 5.1I'm experiencing a similar problem regarding MySQLi (4.1.3) and PHP 5.0.1: $res = $mymysqliobject->query("select * from table") works just fine but $res->num_rows crashes PHP (segfault, apache reports signal 11). It is reproducible by using the demo script given at http://www.zend.com/php5/articles/php5-mysqli2.php and replacing the line "var_dump($result->fetch_row());" by "echo $result->num_rows;".