Thank you in advance.
Windows 8
XAMPP 1.8.1
Apache 2.4.3
MySQl 5.5.27 (Community Server)
PHP 5.4.7 (VC9 X86 32bit thread safe) + PEAR
OpenSSL 1.0.1c
XAMPP Control Panel v3.1.0 3.1.0
Apache and MySQL Service Modules showing green.
Apache and MySQL Running.
With the UPDATE statement, The program does not compile giving the following error;
Parse error: syntax error, unexpected 'customer' (T_STRING) in C:\xampp\htdocs\project\connect\DelUser2.php on line 28
customer is the name of the table in Database jq2.
UPDATE statement works in the phpmyadmin(SQL window) but not when running the .php file in the browser.
I gave global privileges to localhost for the database and the customer table.
INSERT AND DELETE statements function correctly.
-----------------------------------------------------------------------------------------------------
<?php
$mysqli = new mysqli('localhost', 'root', 'pass', 'jq2');
if (!$mysqli)
{
die('mysqli_init failed');
}
if (!$mysqli->options(MYSQLI_INIT_COMMAND, 'SET AUTOCOMMIT = 0'))
{
die('Setting MYSQLI_INIT_COMMAND failed');
}
if (!$mysqli->options(MYSQLI_OPT_CONNECT_TIMEOUT, 30))
{
die('Setting MYSQLI_OPT_CONNECT_TIMEOUT failed');
}
if (!$mysqli->real_connect('localhost', 'root', 'pass', 'jq2'))
{
die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error());
}
/* this succeeds */
echo 'Success... ' . $mysqli->host_info . '<br>';
/* UPDATE fails to be compiled */
UPDATE customer SET MemId=1 WHERE ID=0 ORDER BY UserName LIMIT 1 ;
$mysqli->close();
?>