Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

I get this error when trying to connect to the mycoffee database in Login.php

The php database mycoffee in on Godaddy webhost

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

Index.php

<?php session_start(); ?> Espresso Coffee Makers <?php include("mylibrary/login.php"); include("mylibrary/showproducts.php"); login(); ?>

This is the Login.php

<?php function login() { $con = mysql_connect("localhost","mycoffee","Dallastx1","mycoffee") or die('Could not connect: ' . mysql_error'); mysql_select_db("store", $con) or die('Could not connect to database: ' . mysql_error'); } ?>

Please advise . you help is greatly appreciated. thank you

Mike

I think the problem lies in the ’ after mysql_error ( which by my knowledge is a method and should be called with hooks, like :
[php]
mysql_error()
[/php]
)

Note that you need to fix the same problem in two lines.

Hope this helps you,
O.

Sponsor our Newsletter | Privacy Policy | Terms of Service