My query: Not work.
#1

Hello !

I use MySQL.

My plugin is MySQL R39-2.

I have a query with AND, OR... But it's not work.

pawn Код:
SELECT FROM_UNIXTIME(`Timestamp`, '%%d-%%m-%%Y') AS Timestamp, id, SMS, NumeroSuppr, NumeroToSuppr, Numero, NumeroTo FROM `historique` WHERE Numero = %d AND NumeroSuppr != 1 OR NumeroTo = %d AND NumeroToSuppr != -1 AND Type = 1
I hid the settings to avoid unnecessary code, to understand the request.

For example, it can select the fields in my database type 1 and type 2, when I specified only 1 ...

++
Reply
#2

Does this query work in phpmyadmin?
Reply
#3

Yes, it does encarde as:

NumeroSuppr
NumeroToSuppr
Numero
NumeroTo
Reply
#4

Sorry I dont really understand this query..
Reply
#5

I select all the fields in my table "historique":

Timestamp, id, SMS, NumeroSuppr, NumeroToSuppr, Numero, NumeroTo

And I compare with the player's number:

If the field "Number" of the table is equal to its number and the "NumeroSuppr" value is different from 1 or the value "NumeroTo" is equal to its number and the value "NumeroToSuppr" is different from 1 and the Type field is 1 then the request is made
Reply
#6

No wonder why this isn't working, its totally a mind flipping query.
Reply
#7

Just use samp features for this.
Get all values to variables,
for comparison use if()
Reply
#8

In a query with MySQL?

How to? x)
Reply
#9

Quote:
Originally Posted by Baltimore
Посмотреть сообщение
For example, it can select the fields in my database type 1 and type 2, when I specified only 1 ...

++
Explain more what do you want exactly. (and send me a public message when it's done).
Reply
#10

Basically, I have a "Type" column in my table.

This column can have multiple values: 1, 2.

I want to select (for example) the values at 2, not 1.

But malgrиs my request, it selects me the same values to 1.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)