Mysql Problem
#1

Don't update table Cars

In mysql_log is write:
ProcessQueryThread(SendQuery) - Executing query UPDATE `cars` SET `propietar` = Gireada, `model` = 415, `numar` = LA-1, `pret` = 1, `culoare1` = 1, `culoare2` = 1, `spawnx` = 1497.799560, `spawny` = -1743.912353, `spawnz` = 13.320167, `spawna` = 269.339202, `cumparata` = 1, `donata` = 0, `inchisa` = 0 WHERE `id` = '1'...
[10:11:40] ProcessQueryThread(SendQuery) - Error will be triggered to OnQueryError().


On the OnQueryError don't have error.

Код:
new query[300];
	format(query, sizeof(query), "UPDATE `cars` SET `propietar` = %s, `model` = %d, `numar` = %s, `pret` = %d, `culoare1` = %d, `culoare2` = %d, `spawnx` = %f, `spawny` = %f, `spawnz` = %f, `spawna` = %f, `cumparata` = %d, `donata` = %d, `inchisa` = %d \
	WHERE `id` = '%d'",
		VehInfo[vehicleid][Propietar],
		VehInfo[vehicleid][Model],
		VehInfo[vehicleid][Numar],
		VehInfo[vehicleid][Pret],
		VehInfo[vehicleid][Culoare1],
		VehInfo[vehicleid][Culoare2],
		VehInfo[vehicleid][Spawnx],
		VehInfo[vehicleid][Spawny],
		VehInfo[vehicleid][Spawnz],
		VehInfo[vehicleid][Spawna],
		VehInfo[vehicleid][Cumparata],
		VehInfo[vehicleid][Donata],
		VehInfo[vehicleid][Lock],
		VehInfo[vehicleid][ID]);
On login system update my table.

Executing query UPDATE `users` SET `skin` = 0, `score` = 0, `money` = 10000, `job` = 0, `faction` = 0, `rank` = 0, `admin` = 6, `mute` = 0, `muter` = 0, `lock` = 0, `car` = 0,`tir` = 0, `bike` = 0, `arma` = 0, `prison` = 0, `prisont` = 0 WHERE `name` = 'Gireada'...
ProcessQueryThread(SendQuery) - Query was successful.



Sorry for bad english
Reply
#2

Set all parameters into a ' like `propietar` = '%s', `model` = '%d', and so on
Reply
#3

Quote:
Originally Posted by Gireada
Посмотреть сообщение
[10:11:40] ProcessQueryThread(SendQuery) - Error will be triggered to OnQueryError().
First of all, for strings use:
pawn Код:
'%s'
instead of just:
pawn Код:
%s
Debug it.
pawn Код:
new query[300];
    format(query, sizeof(query), "UPDATE `cars` SET `propietar` = %s, `model` = %d, `numar` = %s, `pret` = %d, `culoare1` = %d, `culoare2` = %d, `spawnx` = %f, `spawny` = %f, `spawnz` = %f, `spawna` = %f, `cumparata` = %d, `donata` = %d, `inchisa` = %d \
    WHERE `id` = '%d'"
,
        VehInfo[vehicleid][Propietar],
        VehInfo[vehicleid][Model],
        VehInfo[vehicleid][Numar],
        VehInfo[vehicleid][Pret],
        VehInfo[vehicleid][Culoare1],
        VehInfo[vehicleid][Culoare2],
        VehInfo[vehicleid][Spawnx],
        VehInfo[vehicleid][Spawny],
        VehInfo[vehicleid][Spawnz],
        VehInfo[vehicleid][Spawna],
        VehInfo[vehicleid][Cumparata],
        VehInfo[vehicleid][Donata],
        VehInfo[vehicleid][Lock],
        VehInfo[vehicleid][ID]);
print(query); // Let's see what it prints.
And then go to phpMyAdmin and execute the query was printed. It will tell you the error was occured. Last,
show us the results.
Reply
#4

EDIT: I found the problem thanks a lot all

This is what printed UPDATE `cars` SET `propietar` = 'Gireada', `model` = 71, `numar` = 'џLA-2', `pret` = 76, `culoare1` = 1, `culoare2` = 1, `spawnx` = 0.000000, `spawny` = 1485.490966, `spawnz` = -1735.882080, `spawna` = 13.196764, `cumparata` = 1134366463, `donata` = 1, `inchisa` = 0 WHERE `id` = '0'

and on phpmyadmin


but now the value is wrong џLA-2 and id = 0?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)