Well this is a really, really bad way to do this. Whatever you are using this for, you should think of redesigning the system.
However in answer to your question:
Code:
local GetNPlayers = CharDBQuery("SELECT `name` FROM `table_name`;") -- getting table
local NPlayers = GetNPlayers:GetColumn(1):GetString() -- this column stores character name
if NPlayers then
local player = nil
for _,plr in pairs(GetPlayersInWorld()) do
if plr:GetName() == NPlayers then
player = plr
break
end
end
if player then
player:SendBroadcastMessage("Hello")
end
end