MySQL Forums
Forum List  »  PHP

php does not update / connect to mysql
Posted by: Curtis McCully
Date: May 22, 2005 01:12AM

Hi all



I am having a similer problem to Kerr Avon. When I run a simple php script to add information to my mysql database the script runs but no output is generated and no modifications are made to the database.

Pertinent info:
Windows Xp.
Latest editions of Apache 1, Mysql, and Php 5.
Can connect to and modify database in mysql moniter and php_myadmin.
phpinfo(); reports that mysql support is enabled.

The script I am using is as follows:

<?
$username="root";
$password="mypassword";
$database="nurse_ed";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO email_address VALUES ('','John','Smith','johnsmith@gowansnet.com','This is a test!');
mysql_query($query);
mysql_close();
?>

No error are logged under mysql but apache shows the following:

[client 127.0.0.1] PHP Parse error: syntax error, unexpected $end in C:\\Program Files\\Apache Group\\Apache2\\htdocs\\test_data_insert.php on line 10



Any help is apopreciated!



Curtis

Options: ReplyQuote


Subject
Written By
Posted
php does not update / connect to mysql
May 22, 2005 01:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.