PHP Warning: mysqli_begin_transaction()

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP Warning: mysqli_begin_transaction()

Postby toreachdeepak » 13. October 2016 10:40

Hello,

I am using PHP 5.6.24

=================My Program========================================
$link = mysqli_connect("127.0.0.1", "root", "", "testdb");

if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

mysqli_begin_transaction($link, MYSQLI_TRANS_START_READ_ONLY);

mysqli_query($link, "SELECT name,age FROM person_table LIMIT 1");
mysqli_query($link, "SELECT name,age FROM person_table LIMIT 5");
mysqli_commit($link);

mysqli_close($link);
======================================================================

I get the following warning

PHP Warning: mysqli_begin_transaction(): This server version doesn't support 'R
EAD WRITE' and 'READ ONLY'. Minimum 5.6.5 is required in C:\xampp\htdocs\commit1
.php on line 10
toreachdeepak
 
Posts: 22
Joined: 05. June 2009 06:42

Re: PHP Warning: mysqli_begin_transaction()

Postby Nobbie » 13. October 2016 11:01

And what? A clear message including the fix - what are you missing?
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: PHP Warning: mysqli_begin_transaction()

Postby toreachdeepak » 13. October 2016 11:15

Hello Nobbie,

Why I am getting the warning when my PHP Version is 5.6.24. Is there any fix to this problem ? Please send me the the fix.

Regards

Deepak
toreachdeepak
 
Posts: 22
Joined: 05. June 2009 06:42

Re: PHP Warning: mysqli_begin_transaction()

Postby Nobbie » 13. October 2016 11:28

Thats only MININUM requirement, did you follow http://php.net/manual/en/mysqli.begin-transaction.php? Which engine did you declare on the table?

Anyway, version 5.6.5 relates to the MySQL Version(!), whereas you are referring to the PHP Version (which is similar, unfortunately). Which MySQL Version are you running?

toreachdeepak wrote:Why I am getting the warning when my PHP Version is 5.6.24.


See above. Because the PHP Version does not matter, the MySQL Version matters.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: PHP Warning: mysqli_begin_transaction()

Postby toreachdeepak » 13. October 2016 11:48

Hello Nobbie,

I downloaded xampp-win32-5.6.24-1-VC11-installer.exe. Which version of mysql does it have ? When I open the mysql from command line

========================================================================================================
C:\Users\abc>mysql -u root -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 86
Server version: 10.1.16-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>
=================================================================================
toreachdeepak
 
Posts: 22
Joined: 05. June 2009 06:42

Re: PHP Warning: mysqli_begin_transaction()

Postby Nobbie » 13. October 2016 12:05

I dont know, ask Bitnami. But dont confuse PHP Version and Server Version (which relates to MySQL / MariaDB). Maybe MariaDB does not support transactions, maybe the message itself is faulty, anyway, the message tells you AT LEAST to use MySQL 5.6.5.

If Xampp / MariaDB does not support transactions, you cannot use it. Ask Bitnami.
Nobbie
 
Posts: 8770
Joined: 09. March 2008 13:04

Re: PHP Warning: mysqli_begin_transaction()

Postby toreachdeepak » 13. October 2016 12:12

Hi Nobbie,

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE '%version%';
+-------------------------+---------------------------------
| Variable_name | Value
+-------------------------+---------------------------------
| innodb_version | 5.6.30-76.3
| protocol_version | 10
| slave_type_conversions |
| version | 10.1.16-MariaDB
| version_comment | mariadb.org binary distribution
| version_compile_machine | 32
| version_compile_os | Win32
| version_malloc_library | system
| version_ssl_library | YaSSL 2.3.9b
+-------------------------+---------------------------------
9 rows in set (0.00 sec)
toreachdeepak
 
Posts: 22
Joined: 05. June 2009 06:42


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 35 guests