Jump to content

[Help] SQL


Stranger

Recommended Posts

hello , i'm working on vehicle shop so

i'm trying to make when the vehicle get destroyed the color of the vehicle saved

on the sql when i do the UPDATE in the sql so

it shows on the database in the color's column the price of the vehicle at each one of the column

i've tried so many ways but not one of those ways works with me, so help

here is the code:

executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", r, g, b, cost, getPlayerAccount (source), id) 

i guess the problem only here so,

Link to comment

Well, if they are TEXT, then you need to do somethig like:

executeSQLQuery ("UPDATE `Vehs` SET `ColorR` = ?, `ColorG` = ?, `ColorB` = ?, `cost` = ? WHERE `Account` = ? AND `Model` = ?", tostring(r), tostring(g), tostring(b), cost, getAccountName(getPlayerAccount (source)), id) 

EDIT:

You don't need tostring(getAccountName(getPlayerAccount (source))) because getAccountName returns a string by default.

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...