MySQL Forums
Forum List  »  PHP

Re: Accessing Databases from a Non-Root Account with PHP
Posted by: Peter Brawley
Date: September 23, 2015 11:56AM

> $conn = new mysqli($servername, $username, $password);

Missing 4th param for database name

> $db = 'test';
> $mysqli = mysqli_connect('$hostname', '$user', '$pwd', '$db');

Lose quotes around args (PHP does var substitution inside double quotes, not inside single quotes).

> When logged in to the MySQL client as kiusau, I see only.

What are kiusau's privileges?

> $res = mysqli_query($mysqli, "SELECT 'Please, do not use ', AS _msg FROM DUAL");

The comma in the query is a syntax error, lose it.

Options: ReplyQuote


Subject
Written By
Posted
Re: Accessing Databases from a Non-Root Account with PHP
September 23, 2015 11:56AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.