mysql_query("select

05/07/2014 12:33 MrLibya#1
Hallo

That My First Time To Use Mysql In Quest
So Litile Help PLz:)

You See In The Quest :
PHP Code:
        when login begin
        local title 
mysql_query("select * from player.news where id = '"..l.."' ")
        
local title_table = {}
        for 
1,table.getn(news),do
        
table.insert(title_table,news.title[i])
    
end
        local m 
select_table(title_table)
        
say_title(title_table[m]) 
Sql:
</b>
PHP Code:
CREATE TABLE `news` (
`
id`  int(16NOT NULL ,
`
title`  varchar(50NOT NULL ,
`
text1`  varchar(50NOT NULL ,
`
text2`  varchar(50NOT NULL ,
`
text3`  varchar(50NOT NULL ,
`
text4`  varchar(50NOT NULL ,
`
text5`  varchar(50NOT NULL ,
PRIMARY KEY (`id`)
)


But In The Sql I Write In
ID : 1
title : Test

[Only registered and activated users can see links. Click Here To Register...]

It's Has To Be When I Login The Game
I Have To Get The Word That I Write In The Sql
But Nothing Show To Me :o

Sry For My Bed English:(
05/07/2014 17:22 Ʀyuzaki#2
PHP Code:
        when login begin
        local title 
mysql_query("select * from player.news where id = '"..l.."' ")
        
local title_table = {}
        for 
1,table.getn(title),do
            
table.insert(title_table,title.title[i])
        
end
        local m 
select_table(title_table)
        
say_title(title_table[m]) 
05/07/2014 17:49 MrLibya#3
Not Work
05/07/2014 17:53 Lord iRemix#4
Which mysql query function do you use?
05/07/2014 18:18 ProfessorEnte#5
PHP Code:
when login begin
    local title 
mysql_query("select * from player.news where id = '"..l.."' ")
    
local title_table = {}
    for 
1,table.getn(news),do
        
table.insert(title_table,news.title[i])
    
end
    local m 
select_table(title_table)
    
say_title(title_table[m]) 
There is no "news" table.

PHP Code:
when login begin
    local title 
mysql_query("select * from player.news where id = 1 ")
    
local title_table = {}
    for 
1,table.getn(title),do
        
table.insert(title_table,title.title[i])
    
end
    local m 
select_table(title_table)
    
say_title(title_table[m]) 
05/07/2014 20:02 MrLibya#6
Quote:
Originally Posted by ProfessorEnte View Post
PHP Code:
when login begin
    local title 
mysql_query("select * from player.news where id = '"..l.."' ")
    
local title_table = {}
    for 
1,table.getn(news),do
        
table.insert(title_table,news.title[i])
    
end
    local m 
select_table(title_table)
    
say_title(title_table[m]) 
There is no "news" table.

PHP Code:
when login begin
    local title 
mysql_query("select * from player.news where id = '"..l.."' ")
    
local title_table = {}
    for 
1,table.getn(title),do
        
table.insert(title_table,title.title[i])
    
end
    local m 
select_table(title_table)
    
say_title(title_table[m]) 
There news table in plyer i make it :)

Quote:
Originally Posted by [iRemix] View Post
Which mysql query function do you use?
I Really Don't Know :D
My First Time To Use The Mysql , So I Don't Know Allot :o
05/07/2014 20:21 ProfessorEnte#7
Quote:
Originally Posted by MrLibya View Post
There news table in plyer i make it :)



I Really Don't Know :D
My First Time To Use The Mysql , So I Don't Know Allot :o
but there is no news table in your quest. You save the result of the query in the table " title" so you are only able to access the values through this table.
05/07/2014 22:17 MrLibya#8
Can You Edit It To Make It save In news table ?
05/08/2014 07:11 Mijago#9
He already did!
Please keep your eyes open :o
05/08/2014 10:55 MrLibya#10
Yes But Didn't Work