Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse error: parse error, unexpected T_STRING

Status
Not open for further replies.

claimskim

Programmer
Apr 14, 2003
5
US
The error I get is:
Parse error: parse error, unexpected T_STRING in /home/content/k/k/b/kkbroughton/html/opendb.php on line 6

Below is the code.

<?php
//
// This file is to be used in conjunction with dbconfig.php to connect to, and select a db for use.
//
//
$conn = mysql connect($dbhost, $dbuser, $dbpass) or die
('Error connecting to mysql');
mysql_select_db($dbname);
?>

Does anyone see what I did wrong? I copy pasted most of the code as I'm completely new to PHP.

I'm getting a parse error on every file I have uploaded but two (All have errors:
 
i suspect that this should be mysql_connect(). You are missing the underscore.
 
Thank you so much, at least it changed the error. It now says:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/usr/local/mysql-5.0/data/mysql.sock' (2) in /home/content/k/k/b/kkbroughton/html/opendb.php on line 6
Error connecting to mysql
 
then the mysql server is not accepting socket connections at that address and/or with those credentials.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top