Sign in to follow this  
djharbi2

[Help] Mysql Charset

Recommended Posts

Hi, saving datebase. But does not record the question properly


entered: your favorite writer?
saved: your favorite writer'

(? instead  '  is happening)

database charset: utf-8

how can I solve this problem?

local username = "root"
local password = "123456"
local b_data = dbConnect("mysql","dbname=mtaserver;host=localhost;charset=utf8;port=3311", username, password, "autoreconnect=1"),

local b_username = "admin"
local b_pass = "1234"
local b_ques = "your favorite writer?"
local b_answ = "T. Well"
local b_money = "0"

local bank = dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES('"..b_username.."','"..b_pass.."','"..b_ques.."','"..b_answ.."','"..b_money.."')")

 

Edited by djharbi2

Share this post


Link to post
3 minutes ago, salh said:

where is b_date?

I didn't write it here, it normally exists

Share this post


Link to post
1 hour ago, djharbi2 said:

Does anyone know the problem?

 

Try, like this:

dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES (?,?,?,?,?)", b_username, b_pass, b_ques, b_answ, b_money)

 

Share this post


Link to post
5 minutes ago, stPatrick said:

 

Try, like this:


dbExec(b_data, "INSERT INTO bank (bank_username,bank_pass,bank_ques,bank_answ,bank_money) VALUES (?,?,?,?,?)", b_username, b_pass, b_ques, b_answ, b_money)

problem persists

Share this post


Link to post

Can you show us an outputDebugString showing the data that you are trying to insert?

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.