Welcome to WebmasterWorld Guest from 54.198.134.32

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

unexpected T CONSTANT ENCAPSED STRING

syntax error on line 8

     
7:42 pm on Apr 30, 2012 (gmt 0)

New User

5+ Year Member

joined:Apr 30, 2012
posts: 6
votes: 0


Here are lines 6-10 of my code:
if (mysqli_connect_errno())
{
echo 'Error: Could not connect to database. Please try again later.';
exit;
}
7:58 pm on Apr 30, 2012 (gmt 0)

Senior Member

joined:Nov 12, 2005
posts:5967
votes: 0


There are no errors here. Are you sure you have the correct lines?
8:01 pm on Apr 30, 2012 (gmt 0)

New User

5+ Year Member

joined:Apr 30, 2012
posts: 6
votes: 0


I think I fixed it by using this code as a model:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

// some code

mysql_close($con);
?>
8:05 pm on Apr 30, 2012 (gmt 0)

Senior Member

joined:Nov 12, 2005
posts:5967
votes: 0


Cool, glad you figured it out.
8:07 pm on Apr 30, 2012 (gmt 0)

New User

5+ Year Member

joined:Apr 30, 2012
posts: 6
votes: 0


Thanks for your help, eelixduppy. I'm not sure why the other coding didn't work, but this at least is working for me.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members