Posts: 36
Threads: 7
Joined: May 2016
Reputation:
0
SELECT * FROM `BanData` WHERE `Expires On` > NOW() AND `User`='Alex' OR `IP Address`='127.0.0.1'
Resulting in 0 rows but there are.. however, if I remove " OR `IP Address`='127.0.0.1' " it works fine..
help?
Posts: 807
Threads: 10
Joined: Jan 2013
Reputation:
0
Why have you got spaces in your column names?
Posts: 241
Threads: 18
Joined: Oct 2013
Reputation:
0
Have you check your logs folder? It might be outputting something
Posts: 36
Threads: 7
Joined: May 2016
Reputation:
0
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('0')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('1')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('2')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('3')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('4')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('5')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('6')
[09:11:33] [WARNING] CMySQLResult::GetRowData - invalid row ('1') or field index ('7')
The problem is that even if the ban expired, It will still show me that I'm banned, unlike when I remove OR `IP Address`='127.0.0.1'
And when I remove it, i don't get these errors
Also, when I manually use that query in phpmyadmin, it's resulting in 0 rows, unlike when I remove " OR `IP Address`='127.0.0.1' " as I said
Posts: 579
Threads: 5
Joined: Oct 2015
Remove the spaces from field names, also show the full mysql log where the query actually executes.
Posts: 180
Threads: 3
Joined: Mar 2018
Posts: 180
Threads: 3
Joined: Mar 2018
Posts: 2,593
Threads: 34
Joined: Dec 2007
pawn Код:
"SELECT * FROM `BanData` WHERE `ExpiresOn` > NOW() AND (`User`='%s' OR `IPAddress`='%s')"
?