Jump to content

T_String Error


Go to solution Solved by Ch0cu3r,

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

  • Solution

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.