php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29667 mysqli functions do not work in 5.0.1
Submitted: 2004-08-14 00:26 UTC Modified: 2004-08-28 14:26 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:3 (60.0%)
Same OS:0 (0.0%)
From: yrob at mail dot crpower dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.0.1 OS: Linux 2.6.5-7.104-default
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yrob at mail dot crpower dot com
New email:
PHP Version: OS:

 

 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-15 01:13 UTC] ghostfacekillaz at gmx dot net
Description:
------------
I'm using MySQL 4.1.3-beta

For me the mysqli functions work.
There's just a different behavior I found between PHP 5.0.0 and PHP 5.0.1 in function mysqli_fetch_array

Example:
--------
SQL-Statement: SHOW TABLES FROM databasename

mysqli_fetch_array (PHP 5.0.0) returns:
[0] = tablename

mysqli_fetch_array (PHP 5.0.1) returns:
[Tables_in_databasename] = tablename
 [2004-08-15 14:37 UTC] alatar_ at mail dot ru
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.1
 [2004-08-23 19:47 UTC] helge at eco-logic-software dot de
I'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;".
 [2004-08-28 14:26 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 10:01:30 2024 UTC