djharbi2 Posted June 16, 2019 Posted June 16, 2019 (edited) 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 June 16, 2019 by djharbi2
djharbi2 Posted June 16, 2019 Author Posted June 16, 2019 3 minutes ago, salh said: where is b_date? I didn't write it here, it normally exists
Moderators Patrick Posted June 17, 2019 Moderators Posted June 17, 2019 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)
djharbi2 Posted June 17, 2019 Author Posted June 17, 2019 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
Investor Posted June 18, 2019 Posted June 18, 2019 Could be related to issue 634 as its solution changed some stuff regarding question marks within a query.
MTA Team 0xCiBeR Posted June 18, 2019 MTA Team Posted June 18, 2019 Can you show us an outputDebugString showing the data that you are trying to insert?
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now