0

I created a database through an online site and would like to connect to it from my android Activity. I believe that the core issue is my PHP file. I keep getting a syntax error from this line of code:

$con = mysqli_connect('h31.170.234.43', “markf”, “boston”, “a9208078_mydb”);

The name of my file is Register.php and the error is:

Parse error: syntax error, unexpected T_VARIABLE in /home/a9208078/public_html/Register.php on line 2

First, I'm curious if my parameters are correct, Host Name, the username that I used for that site, my password, and the database name?

Does anyone know why this error is occuring? Thanks so much!

PS: I changed the information around from my actual password and database name for obvious security reasons but the idea is the same

2
  • At quick glance it looks like your quotation marks are not right. Commented Sep 18, 2015 at 0:45
  • 2
    Hope that this isn't your real info for db connection :) Commented Sep 18, 2015 at 1:01

1 Answer 1

2

You're using funky quotes around three parameter values. That's what happens when you copy and paste your code from a blog post or tutorial.

$con = mysqli_connect('h31.170.234.43', 'markf', 'boston', 'a9208078_mydb');

FYI, your IP address is invalid and probably also a copy and paste error or typo.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.