Jump to content

Azaroth

Members
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Azaroth

  • Rank
    Square
  1. Solved. Query can't SELECT Float values.
  2. I think that there is a problem with Query, because when I write another Query then it works. local query = dbQuery(connection, "SELECT * FROM `pickups` WHERE `UID`=40" Works. local query = dbQuery(connection, "SELECT * FROM `pickups` WHERE `posX`=?", tostring(positionX)) Didn't work...
  3. Source - player who clicked lalt. This code gets values from selected row from database, but here it didn't work.
  4. Oh... My first post is wrong... Was thinking about something else and wrote bad post. I want to get positions to teleport from database. function Enter() local ColSphere = getElementsByType ( "colshape" ) for i, Sphere in ipairs(ColSphere) do local positionX, positionY, positionZ = getElementPosition ( Sphere ) tempSphere = createColSphere ( positionX, positionY, positionZ, 2 ) if isElementWithinColShape ( source, tempSphere ) then local query = dbQuery( connection, "SELECT * FROM pickups WHERE posX="..tostring(positionX) )
  5. Ok. Udało mi się pobrać, ale mam inny problem... Próbuję pobrać dane pickup'a z bazy danych, który jest w tym samym miejscu co sfera. local ColSphere = getElementsByType ( "colshape" ) for theKey,Sphere in ipairs(ColSphere) do if isElementWithinColShape ( source, Sphere ) then local posX, posY, posZ = getElementPosition ( Sphere ) local query = dbQuery( connection, "SELECT * FROM pickups WHERE posX="..posX ) local result, numrows, errmsg = dbPoll ( query, -1 ) if numrows > 0 then for result, row in pai
  6. It works without if, but I need to use that... Is there another way to get values from database? if isElementWithinColShape ( source, Sphere ) then
  7. Server is connected to database. Other queries works.
  8. I can't use /debugscript.
  9. Hello. I used dbPoll to get checkpoint model from database, but it works only to line: 7. Tried with outputChatBox(posX). local ColSphere = getElementsByType ( "colshape" ) for theKey,Sphere in ipairs(ColSphere) do if isElementWithinColShape ( source, Sphere ) then local posX, posY, posZ = getElementPosition ( Sphere ) local query = dbQuery( connection, "SELECT * FROM pickups WHERE posX="..posX ) local result, numrows, errmsg = dbPoll ( query, -1 ) if numrows > 0 then for result, row in pairs ( result
  10. Nie działa. Wartość zmiennej to nil... Wiki też dużo nie mówi jak pobrać wartość.
  11. It's connected with mysql_connect. handler = mysql_connect("localhost", "root", "pass", "multi theft auto") @EDIT: Ok. Connected with DbConnect and got values with dbPoll, but I don't understand that dbPoll. Can someone explain me how it works? local query = dbQuery( connection, "SELECT * FROM pickups WHERE UID="..i) local result, numrows, errmsg = dbPoll ( query, -1 ) if numrows > 0 then for result, row in pairs ( result ) do -- by using a second loop (use it if you want to get the values of all columns the query selected): for column, value in pair
  12. local query = dbQuery( handler, "SELECT * FROM pickups" ) It's not working. I get warning: Bad argument @ 'dbQuery' [Expected db-connection at argument 1, got userdata]
  13. Hello. How to get value from MySQL Databasa? I tried mysql_query and mysql_fetch_field. mysql_query returns: MySQL result (#32) and mysql_fetch_field return field name.
×
×
  • Create New...