0

this is privileges setting part

User        Host         Type                Privileges      Grant

username    %            database-specific   ALL PRIVILEGES  No 
root        localhost    global              ALL PRIVILEGES  Yes    

this is mysql part

INSERT INTO `place` (`category`, `zone`, `budget`, `with`, `time`, `name`, `address`, `description`, `website`, `latitude`, `longitude`,`validation`) VALUES (1, 2, 3, 2, 3, 'placename', 'address', 'description', 'website', 100.0001, 33.0001, 0);

this is php part

$con = new mysqli('localhost','username');
$q = "INSERT INTO...";
$con->query($q);

if the sql inserted manually, it's ok. but if i execute the php, it's fail. unfortunately there is no error message come out. this begin after i re-set the privileges for user username

stackunderflow
  • 1,492
  • 1
  • 23
  • 53

1 Answers1

1

My guess is that this is a syntax type error. Possible that you are using backticks (`) instead of single quotes ('). You really need to figure out what the error is however. Try something like this:

    $con = new mysqli('localhost','username');
    $q = "INSERT INTO...";
    if (!$con->query($q)) {
      printf("Errormessage: %s\n", $con->error);
    }
dwjv
  • 1,227
  • 9
  • 15