Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Zapytanie ze zmienną/update tabeli., Drobnostka dla was :}
kubaku4
post 30.04.2010, 17:45:34
Post #1





Grupa: Zarejestrowani
Postów: 11
Pomógł: 1
Dołączył: 30.04.2010

Ostrzeżenie: (0%)
-----


Cześć smile.gif Od dzisiaj bawię się w zapytania i mam taki problemik z zapytaniem. Zapytanie wygląda tak:
  1. UPDATE scxpm_stats SET nick = '*~Niebieski Ranger~*', ip = '127.0.0.1', zmienna = '0', WHERE `authid` = 'STEAM_0:1:18304634'

Błędy:MySQL zwrócił komunikat:

#1064 - Something is wrong in your syntax obok 'WHERE `authid` = 'STEAM_0:1:18304634'" -- Error: Something is wrong in your synt' w linii 1

Proszę o pomoc :]

Ten post edytował kubaku4 30.04.2010, 17:48:33
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 3)
sf
post 30.04.2010, 18:01:52
Post #2





Grupa: Zarejestrowani
Postów: 1 597
Pomógł: 30
Dołączył: 19.02.2003
Skąd: Tychy

Ostrzeżenie: (0%)
-----


usuń przecinek przed WHERE


--------------------
Zapraszam na mój php blog, tworzenie stron.
Go to the top of the page
+Quote Post
kubaku4
post 30.04.2010, 18:25:27
Post #3





Grupa: Zarejestrowani
Postów: 11
Pomógł: 1
Dołączył: 30.04.2010

Ostrzeżenie: (0%)
-----


Pomógł dla ciebie :] Ale kolejny error(programuje w PAWN ^^):
Cytat
[d.amxx] There was an error on loading so stats won't be saved for: *~Niebieski Ranger~*

Kodzik:
  1. public SaveData( id )
  2. {
  3. if ( load_error[ id ] )
  4. {
  5. new nickname[35]
  6. get_user_name(id, nickname, 34)
  7. log_amx("There was an error on loading so stats won't be saved for: %s", nickname)
  8. return 0
  9. }
  10. // just update the row
  11. new host[32], user[32], pass[32], dbname[32], table[32]
  12. get_cvar_string("amx_sql_host", host, 31)
  13. get_cvar_string("amx_sql_user", user, 31)
  14. get_cvar_string("amx_sql_pass", pass, 31)
  15. get_cvar_string("amx_sql_db", dbname, 31)
  16.  
  17. tuple = SQL_MakeDbTuple(host, user, pass, dbname)
  18.  
  19. if ( tuple ) db = SQL_Connect(tuple, errcode, error, 1023)
  20.  
  21. if (db == Empty_Handle)
  22. {
  23. log_amx("Could not connect to database. Error #%i: %s", errcode, error)
  24. if ( db ) SQL_FreeHandle( db )
  25. if ( tuple ) SQL_FreeHandle( tuple )
  26. return 0
  27. }
  28. else
  29. {
  30. new authid[35]
  31. new ip[35]
  32. new nickname[35]
  33.  
  34. new where_statement[1024]
  35. get_cvar_string("scxpm_sql_table", table, 31)
  36. get_user_authid(id, authid, 34)
  37. get_user_ip(id, ip, 199, 1)
  38. get_user_name(id, nickname, 34)
  39. format(where_statement, 199, "`authid` = '%s'", authid)
  40. format(mkQuery, 1023, QUERY_UPDATE_SKILLS_PLUS, table, nickname, ip, zmienna[id], where_statement)
  41. query = SQL_PrepareQuery(db, mkQuery)
  42. SQL_Execute(query)
  43.  
  44. SQL_QueryError(query, error, 1023)
  45. if(error[0])
  46. {
  47. log_amx("Could not execute query ^"%s^" -- Error: %s",mkQuery,error)
  48. if ( db ) SQL_FreeHandle( db )
  49. if ( tuple ) SQL_FreeHandle( tuple )
  50. if ( query ) SQL_FreeHandle( query )
  51. return 0
  52. }
  53. //close the db connection
  54. if ( db ) SQL_FreeHandle( db )
  55. if ( tuple ) SQL_FreeHandle( tuple )
  56. if ( query ) SQL_FreeHandle( query )
  57. }
  58. return 0
  59. }
Go to the top of the page
+Quote Post
Mchl
post 30.04.2010, 20:23:37
Post #4





Grupa: Zarejestrowani
Postów: 855
Pomógł: 145
Dołączył: 17.07.2008
Skąd: High Memory Area

Ostrzeżenie: (0%)
-----


To już nie związane z MySQL.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 00:22