homepage Welcome to WebmasterWorld Guest from 54.211.230.186
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
unexpected T CONSTANT ENCAPSED STRING
syntax error on line 8
jdial



 
Msg#: 4447650 posted 7:42 pm on Apr 30, 2012 (gmt 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;
}

 

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4447650 posted 7:58 pm on Apr 30, 2012 (gmt 0)

There are no errors here. Are you sure you have the correct lines?

jdial



 
Msg#: 4447650 posted 8:01 pm on Apr 30, 2012 (gmt 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);
?>

eelixduppy

WebmasterWorld Senior Member eelixduppy us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4447650 posted 8:05 pm on Apr 30, 2012 (gmt 0)

Cool, glad you figured it out.

jdial



 
Msg#: 4447650 posted 8:07 pm on Apr 30, 2012 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved