php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #51508 MySQL error
Submitted: 2010-04-08 12:42 UTC Modified: 2010-04-09 00:41 UTC
From: tom dot van dot schoor at gmail dot com Assigned: degeberg (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: OSX
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom dot van dot schoor at gmail dot com
New email:
PHP Version: OS:

 

 [2010-04-08 12:42 UTC] tom dot van dot schoor at gmail dot com
Description:
------------
The provided examples generate MySQL errors:

You have an error in your SQL syntax; check the manual that corresponds to your 
MySQL server version for the right syntax to use near 'Type=InnoDB' at line 1

Test script:
---------------
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', '1');

$link = mysqli_connect("localhost", "world", "deadl1ne", "world");

if (!$link) {
    printf("Can't connect to localhost. Error: %s\n", mysqli_connect_error());
    exit();
}

/* set autocommit to off */
mysqli_autocommit($link, FALSE);

mysqli_query($link, "CREATE TABLE Language LIKE CountryLanguage Type=InnoDB");
print mysqli_error($link);
/* Insert some values */
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Bavarian', 'F', 11.2)");
mysqli_query($link, "INSERT INTO Language VALUES ('DEU', 'Swabian', 'F', 9.4)");

/* commit transaction */
mysqli_commit($link);

/* close connection */
mysqli_close($link);
?>


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-08 12:46 UTC] tom dot van dot schoor at gmail dot com
This is for the examples with mysqli::commit

And mysql version 5.0.41
 [2010-04-09 00:41 UTC] degeberg@php.net
Automatic comment from SVN on behalf of degeberg
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=297721
Log: Fixed PHP bug #51508, error in SQL example in mysql::commit() doc page
 [2010-04-09 00:41 UTC] degeberg@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: degeberg
 [2010-04-09 00:41 UTC] degeberg@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 08:00:01 2026 UTC