SA-MP Forums Archive
My query: Not work. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: My query: Not work. (/showthread.php?tid=559649)



My query: Not work. - Baltimore - 24.01.2015

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 ...

++


Re: My query: Not work. - zaibaslr2 - 24.01.2015

Does this query work in phpmyadmin?


Re : My query: Not work. - Baltimore - 24.01.2015

Yes, it does encarde as:

NumeroSuppr
NumeroToSuppr
Numero
NumeroTo


Re: My query: Not work. - zaibaslr2 - 24.01.2015

Sorry I dont really understand this query..


Re : My query: Not work. - Baltimore - 24.01.2015

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


Re: My query: Not work. - Bondage - 24.01.2015

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


Re: My query: Not work. - zaibaslr2 - 24.01.2015

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


Re : My query: Not work. - Baltimore - 24.01.2015

In a query with MySQL?

How to? x)


Re: My query: Not work. - Noliax8 - 24.01.2015

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).


Re : My query: Not work. - Baltimore - 25.01.2015

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.