0

I have installed Prosody and am trying to add users directly to the prosody table instead of prosodyctl command.

table structure:
================
    `host` TEXT NULL,
    `user` TEXT NULL,
    `store` TEXT NULL,
    `key` TEXT NULL,
    `type` TEXT NULL,
    `value` MEDIUMTEXT NULL,

and when I do this

$sql = "INSERT INTO prosody (host, user, store, key, type, value) VALUES ('mydomain.tld', $user, 'accounts', 'password', 'string', $pass)";

I get this error

"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near..."

I suspect that certain words are reserved words so I tried using with ' and escaped with \, but it didn't work. Same error. Can somebody help me?

1 Answers1

0

$sql = "INSERT INTO prosody (host, user, store, key, type, value) VALUES ('mydomain.tld', '$user', 'accounts', 'password', 'string', '$pass')";

Iamgisnet
  • 171
  • 3
  • 3
  • 12
  • Error: INSERT INTO prosody (host, user, store, key, type, value) VALUES ('mydomain.tld', 'test123', 'accounts', 'password', 'string', '91911111111') You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key, type, value) VALUES ('mydomain.tld', 'test123', 'accounts', 'password', 'st' at line 1 – Infinicalls Infinicalls Oct 18 '17 at 15:44