0

I have searched online for hours and haven't found anything that fixes my error. I have a file with this code,

<?php
   class Conn {
   public static $dbhost = “localhost”;
   public static $dbuser = " < provide here user name to your database> ";
   public static $dbpass = "< password you use to access database >";
   public static $dbname = " <database name> ";
   }
?>

and here's my error, Parse error: syntax error, unexpected 'here' (T_STRING), expecting ',' or ';' in /Applications/XAMPP/xamppfiles/htdocs/Registration/Conn.php on line 4

I've tried changing " to ' yet it doesn't help!

I don't have any open strings, so what's the problem???

1 Answers1

0

If you look at your code example, you can see you are using two different types of quotation marks. "localhost" is wrapped in curly quotes (“”), and not normal quotes. ("") This is causing the parsing error.

The difference:

“localhost”
"localhost"
true
  • 221
  • 1
  • 8