Wysłany: 2019-04-09, 09:56
okupski2000
Wiek: 42 Na forum: 3997 dni Posty: 21
Nick w MP: Volvo
Cze??, mam problem ze skryptem na ??czenie si? z baz? danych, a mianowicie:
[19-04-09 09:51] WARNING: [EMS]/DB/sql9384571.lua:31: dbPoll failed; Unknown column 'exp' in 'field list'
[19-04-09 09:51] WARNING: [EMS]/DB/sql9384571.lua:31: dbPoll failed; Unknown column 'exp' in 'field list' [DUP x2]
Skrypt:
--[[
Interfejs obs ? ugi bazy danych - nak ? adka na funkcje db ...
]]--
local root = getRootElement ()
local SQL
local function connect ()
SQL = dbConnect ( "mysql" , "dbname=*******;host=137.74.0.12;port=3306" , "*******" , "*******" , "share=0" )
if ( not SQL ) then
outputServerLog ( "BRAK POLACZENIA Z BAZA DANYCH!" )
else
zapytanie ( "SET NAMES utf8" )
end
end
addEventHandler ( "onResourceStart" , resourceRoot , connect )
function pobierzTabeleWynikow (...)
local h = dbQuery ( SQL ,...)
if ( not h ) then
return nil
end
local rows = dbPoll ( h , - 1 ) ------------ LINIJKA 31
return rows
end
function pobierzWyniki (...)
local h = dbQuery ( SQL ,...)
if ( not h ) then
return nil
end
local rows = dbPoll ( h , - 1 )
if not rows then return nil end
return rows [ 1 ]
end
function zapytanie (...)
local h = dbQuery ( SQL ,...)
local result , numrows = dbPoll ( h ,- 1 )
return numrows
end
function nullCallback ( qh )
dbFree ( qh )
end
function szybkieZapytanie (...)
local h = dbQuery ( nullCallback , SQL ,...)
end
function insertID ()
local r = pobierzWyniki ( "select last_insert_id() lid" )
return r . lid
end
--[[
function affectedRows ()
return mysql_affected_rows ( SQL )
end
]]--
function fetchRows ( query )
local result = mysql_query ( SQL , query )
if ( not result ) then return nil end
local tabela ={}
while true do
local row = mysql_fetch_row ( result )
if ( not row ) then break end
table . insert ( tabela , row )
end
mysql_free_result ( result )
return tabela
end
-- left for compatibility
function esc ( s )
return string . gsub ( s , "['\"\]" , "" )
end
Wysłany: 2019-04-09, 10:14
AmaMa.
AmaMa.#3768
Wiek: 25 Na forum: 3207 dni Posty: 182
Nick w MP: AmaMa.
Piwa : 1825
okupski2000 , To nie wina po??czenia. W db3 pokazuje b??d, kt?ry oznacza, ?e w twojej bazie MySQL nie ma kolumny "exp".
Tagi: nie :: trybi :: skrypt :: łączenie :: bazą :: danych
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: