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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parse error in echo?

Status
Not open for further replies.

jerusalm

Technical User
Sep 30, 2002
3
IL
I keep getting a parse error saying looking for "(". Where am I going wrong?
The code is
If !$db die echo "mysql_errno: " mysql_errno()\n "mysql_error: " mysql_error()\n;
I'm testing to see if the connect to a MYSQL database was successful or not.
 
I don't know how faithful your post is to the code you're actually trying to run, but the line of your code you've posted has a number of punctuation marks missing.

Something like:

If (!$db) die ("mysql_errno: ". mysql_errno()."\n". "mysql_error: ". mysql_error()."\n.");

has a much better chance of actually running.

Want the best answers? Ask the best questions: TANSTAAFL!!
 
When echo'ing, you have to remember to include periods(.) between quoted material and variables

i.e.

echo "Name: " . $name;

as opposed to:

echo "Name: " $name;


Also, escape sequences(\n for newlines) need to be inside of the quotes, as they are interpreted as part of a string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top