MySQL is being gay.

Status
Not open for further replies.

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
So,

I have an update query like so:

"UPDATE chat_admins SET username = '" . $username2 . "',password = '" . $password . "',key = '" . $key . "' WHERE username = 'admin' AND password = 'password'";

But whenever I try and run the stupid thing, I get this retarded 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 'key = '6070' WHERE username = "admin" AND password = 'password'' at line 1

I tried removing the " ' " from the query, still nothing.
Sometimes, when I run this query it messes up my database too.
When I try to go into "chat_admins" it takes me back to phpMyAdmin's home page which means I have to re-create it (using an import).

Any help with this?
 

Weasel

👄 I'd intercept me
Nov 25, 2011
4,135
2,461
I honestly can't find any mistake in the query. Maybe your table is fucked up? For the last thing I recommend to contact your hosting if phpMyAdmin fucks up.
 
  • Like
Reactions: NSA

ViiTactiiCZz

Member
Mar 19, 2013
35
5
try
"UPDATE chat_admins SET username = '" . $username2 . "' AND password = '" . $password . "' AND key = '" . $key . "' WHERE username = 'admin' AND password = 'password'";
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
mysql_query("UPDATE chat_admins SET username = '{$username2}', password = '{$password}', key = '{$key}' WHERE username = 'admin' AND password = 'password'");
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
mysql_query("UPDATE chat_admins SET username = '{$username2}', password = '{$password}', key = '{$key}' WHERE username = 'admin' AND password = 'password'");

Still getting the same error :/
 

TesoMayn

Boredom, it vexes me.
Oct 30, 2011
1,482
1,482
mysql_query("UPDATE chat_admins SET username = '{$username2}', password = '{$password}', key = '{$key}' WHERE username = 'admin'");
 

NSA

sudo apt-get thefuckout.tar.gz
Dec 9, 2011
715
86
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 = '6598' WHERE username = 'admin'' at line 1

The query worked before I implemented the key.
 
Status
Not open for further replies.

Users who are viewing this thread

Top