A very basic mysql example

Moderator: Rathinagiri

Post Reply
martingz
Posts: 395
Joined: Wed Nov 18, 2009 11:14 pm
Location: Mexico

A very basic mysql example

Post by martingz »

Juan Carlos
Leopoldo
Andres
Envio una aplicacion que podran ver como conectar al servidor de mysql, y su uso de inserts y update muy basicos pero suficiente para comenzar, lo del restaurant lo subire despues, gracias a algunos movimientos que hicieron nos dimos cuenta de unos pequeños detalles y estamos trabajando en ellos para poder entregar a tiempo la aplicacion

Nota, al compilar el proyecto, seguramente veran que cuando entran a la opcion de articulos, esta tarda demasiado y tiene un parpadeo molesto, esto lo medio soluciono con un truco que no se si sera lo mejor, pero tarda bastante menos tiempo, y no muestra el parpadeo.

en la linea 547 de h_grid.prg

*_HMG_DOGRIDREFRESH(I)
la cometamos para que no se compile, reconstruimos la libreria y listo, claro que despues de eso, tenemnos que poner manualmente un refres al grid en nuestros programas.

saludos


Google Translation
I send an application that will see how to connect to mysql server, and use of inserts and update very basic but enough to start, so I'll upload the restaurant later, thanks to some moves that did we realized a few details and are working on them to deliver on time the application

Note, when you compile the project, I will see that when they come to the choice of articles, this takes too long and has an annoying flicker, this half fix it with a trick that is not the best, but it took far less time, and
shows no flicker.

on line 547 of h_grid.prg

* _HMG_DOGRIDREFRESH (I)
the commit to not compile, rebuilt the library and ready, of course after that, we have to manually refresh the grid in our programs.

regards
Attachments
MyPos.zip
(944.85 KiB) Downloaded 620 times
User avatar
danielmaximiliano
Posts: 2612
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: A very basic mysql example

Post by danielmaximiliano »

Hola Martín : tarde pero seguro !!! :lol: voy a probar y cer tu aporte.

gracias por compartir ....
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

Re: A very basic mysql example

Post by bels79 »

I try to connect to xampp , if we are using localhost can use the ip but could not. can you please help .

thank you
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: A very basic mysql example

Post by Rathinagiri »

1. While loading data to a grid use
<Windowname>.<ControlName>.DisableUpdate()

and after that use

<Windowname>.<ControlName>.EnableUpdate()

2. You can use this too.

- <ParentWindowName>.<GridControlName>.PaintDoubleBuffer [ := | -->] lBoolean // Paints via double-buffering, which reduces flicker

3. If the number of rows in a grid runs to thousands you have to use virtual grid.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: A very basic mysql example

Post by dragancesu »

You have very little information and should not be a problem with the display
Navigation missing on forms, exist but without picture can not be seen
Look at a small example

Description
art.prg - form program for table articulo
mysqlfn.prg - functions work with database
config.ini - set connect parameters, host, database and user

and need libmysql.dll
Attachments
mypos1.zip
(18.26 KiB) Downloaded 336 times
bels79
Posts: 37
Joined: Fri Sep 09, 2011 8:01 am
DBs Used: DBF, MySQL

Re: A very basic mysql example

Post by bels79 »

I have 2 computers with ip 192.168.1.2 and 192.168.1.3
my xampp installed on the computer 192.168.1.2 .
I can run the program on the computer 192.168.1.2 .
whereas if there is an error of 192.168.1.3 "no connection to the server " .

if the browser ( firefox ) on both the computer it could be.

can you please help .

thank you
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: A very basic mysql example

Post by dragancesu »

What is conection string on both computers?
User avatar
serge_girard
Posts: 3165
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: A very basic mysql example

Post by serge_girard »

Bels79,

You probably should connect your second PC by using real IP-address.
You can find your IP-address by https://www.iplocation.net/find-ip-address

Serge
There's nothing you can do that can't be done...
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: A very basic mysql example

Post by Rathinagiri »

Is there any firewall obstructing the mysql port in both the computers? (usually 3306)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
dragancesu
Posts: 921
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: A very basic mysql example

Post by dragancesu »

When install webserver like wamp,xampp then often can access from localhost but not other ip address
Attachments
users.png
users.png (33.12 KiB) Viewed 5314 times
Post Reply