-5

Can someone tell me what the parse error is in this script!, would much appreciate it.

mysql_connect ('localhost','root','root'); or die ("mysql_error"());
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • 3
    You are using [an **obsolete** database API](http://stackoverflow.com/q/12859942/19068) and should use a [modern replacement](http://php.net/manual/en/mysqlinfo.api.choosing.php). – Quentin May 17 '14 at 06:18
  • hope you get the solution from answer below. But I recommend you to use more safer extension like `mysqli_*` or `PDO` – Md. Sahadat Hossain May 17 '14 at 06:24

2 Answers2

3

Remove the first semicolon. ; or is not valid.

Also, you shouldn't typically be quoting mysql_error:

mysql_connect ('localhost','root','root') or die(mysql_error());
Amber
  • 507,862
  • 82
  • 626
  • 550
3

Remove the ; after mysql_connect and also the quotes in mysql_error().

mysql_connect ('localhost','root','root') or die (mysql_error());

For reference: Connecting to database

Jenz
  • 8,280
  • 7
  • 44
  • 77