This topic is locked
[SOLVED]

 How to pick and customize the content of a message passed by MySQL?

4/29/2015 7:07:10 PM
PHPRunner General questions
A
Aruanan author

Hi, All!.... (...sorry for my weak English! <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=23118&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' /> )
HELP!
In PHPRunner, how can I catch and translate (or manipulate) a message comming from MySQL before print or echo for user?
For example:
[indent][/indent]my code print ""..... This is the same message.... but in my language!.... I NEED TO DO THIS!
FYI: I´m using PHPRunner 7.1 Enterprise Edition and XAMPP 5.6.3 / MySQL 5.6.21 - MySQL Community Server (GPL)
TKS A LOT!

Aruanan Avelino

Sergey Kornilov admin 4/29/2015

You cannot intercept those messages but even if you could that would be a bad idea. Your customers won't understand what "Duplicate entry '1-1-01' for key 'um'" means or how to fix it.
Correct approach is to avoid errors like this. If you allow users to enter foreign or primary key field values manually implement BeforeEdit/BeforeAdd event and check field value for uniqueness there. If duplicate detected tell them in plain Spanish what needs to be changed.
Better yet, change your application the way users don't need to enter any foreign or primary key field values manually.

A
Aruanan author 4/30/2015



You cannot intercept those messages but even if you could that would be a bad idea. Your customers won't understand what "Duplicate entry '1-1-01' for key 'um'" means or how to fix it.
Correct approach is to avoid errors like this. If you allow users to enter foreign or primary key field values manually implement BeforeEdit/BeforeAdd event and check field value for uniqueness there. If duplicate detected tell them in plain Spanish what needs to be changed.
Better yet, change your application the way users don't need to enter any foreign or primary key field values manually.


Hello, Sergey.
Congratulations for the excellent work that your staff and you realize. I work in the information technology field for more than 40 years and, for me, the PHPRunner is one of the best tools with which I could ever work.
Thanks for the reply and the advice. For now, I'm just getting to know the breadth and resources that I can have and apply through PHPRunner. Thanks for the reply and the advice. For now, I'm just trying to know the range of resources that I have through the use of PHPRunner.
FYI: I've got a simple translation of the MySQL messages: I used the command "language" in the my.ini file (see below).
# The MySQL server

[mysqld]

port= 3306

socket = "C:/xampp/mysql/mysql.sock"

basedir = "C:/xampp/mysql"

tmpdir = "C:/xampp/tmp"

datadir = "C:/xampp/mysql/data"

[color="#FF0000"]language = "C:/xampp/mysql/share/portuguese"

pid_file = "mysql.pid"[/color]

[]´s

Aruanan Avelino