0

i am getting this error after uploading my page to server :

Parse error: syntax error, unexpected T_LOGICAL_OR in /data/19/1/86/59/1901711/user/xxxx/htdocs/Maxxxxxxt/Mxxxxxxe/Pxx/txxx/index.php on line 11

on line i have this database statement , which is working fine when i am using it at localhost.

$objConnect = mysql_connect('localhost','root',''); or  die(mysql_error());

i have tried up every settings but they are all helpless, let me know what i am doing wrong ? and what is to be done to fix it up ?

devilcrab
  • 141
  • 4
  • 21
  • 2
    You need to remove the `'root','');` semi-colon after closing the round bracket as you are ending your statement there and than you are using OR operator – Mr. Alien Apr 23 '13 at 07:13
  • Try to use PDO or Mysqli the mysql functions ar deprecated from php version 5.0. Read more: http://stackoverflow.com/questions/548986/mysql-vs-mysqli-in-php – S.Visser Apr 23 '13 at 07:15

4 Answers4

2

Remove semicolon

$objConnect = mysql_connect('localhost','root',''); or  die(mysql_error());

after mysql_connect function change it to this

$objConnect = mysql_connect('localhost','root','') or  die(mysql_error());
chandresh_cool
  • 11,753
  • 3
  • 30
  • 45
2

Drop the ; behind the mysql_connect():

$objConnect = mysql_connect('localhost','root','') or die(mysql_error());

Besides, have a look at PDO and mysqli, as the mysql_x functions are deprecated!

Sirko
  • 72,589
  • 19
  • 149
  • 183
1
$objConnect = mysql_connect('localhost','root',''); or  die(mysql_error());

should be

$objConnect = mysql_connect('localhost','root','') or  die(mysql_error());
                                                  ^ removed ;
Class
  • 3,149
  • 3
  • 22
  • 31
1

Remove ; from here

 'root',''); or  die(mysql_error());
           ^
Yogesh Suthar
  • 30,424
  • 18
  • 72
  • 100