Jump to content

T_String Error


cdmafra

Recommended Posts

Hello. I have a strange error T_String, because it was not there until I changed my server. I updated my details, but returns:
Parse error: syntax error, unexpected T_STRING in /usr/home/motorra/public_html/login/db_connect_close.php on line 4
 
1. <?php
2. $link = mysql_connect("localhost", "USER", "PASS")
3. // Close connection
4. mysql_close($link);
5. ?>

 

Link to comment
https://forums.phpfreaks.com/topic/287059-t_string-error/
Share on other sites

You have left off the ; at the end of line 2

$link = mysql_connect("localhost", "USER", "PASS"); // <-- missing semi-colon at end of line

NOTE: If you are starting to lean to use MySQL databases with PHP, then I strongly encourage  you to not carry on using the standard mysql_* functions. Instead use MySQLi instead.

 

The mysql_* function are deprecated and could so be removed completely from newer versions of PHP. 

Link to comment
https://forums.phpfreaks.com/topic/287059-t_string-error/#findComment-1473004
Share on other sites

I noted that meanwhile. Many thanks!

 

You have left off the ; at the end of line 2

$link = mysql_connect("localhost", "USER", "PASS"); // <-- missing semi-colon at end of line

NOTE: If you are starting to lean to use MySQL databases with PHP, then I strongly encourage  you to not carry on using the standard mysql_* functions. Instead use MySQLi instead.

 

The mysql_* function are deprecated and could so be removed completely from newer versions of PHP. 

 

Link to comment
https://forums.phpfreaks.com/topic/287059-t_string-error/#findComment-1473006
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.