HMGSCRIPT R42

Moderator: Rathinagiri

User avatar
serge_girard
Posts: 2277
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 532 times
Been thanked: 114 times
Contact:

Re: HMGSCRIPT R42

Post by serge_girard » Tue Feb 19, 2019 10:09 am

Jair,

Cannot test while missing themes/desktop.css and lib/hmgscript.js

Serge

User avatar
jairpinho
Posts: 293
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Has thanked: 3 times
Been thanked: 8 times
Contact:

Post by jairpinho » Tue Feb 19, 2019 12:20 pm

serge_girard wrote:
Tue Feb 19, 2019 10:09 am
Jair,

Cannot test while missing themes/desktop.css and lib/hmgscript.js

Serge
I used the hmgscript42 folder, use this folder as reference and add the uploaded files
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
serge_girard
Posts: 2277
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 532 times
Been thanked: 114 times
Contact:

Post by serge_girard » Tue Feb 19, 2019 3:43 pm

Jair,

Missing /php/mysql.php AND themes/desktop.css !

Serge

User avatar
jairpinho
Posts: 293
Joined: Mon Jul 18, 2011 5:36 pm
Location: Rio Grande do Sul - Brasil
Has thanked: 3 times
Been thanked: 8 times
Contact:

Post by jairpinho » Tue Feb 19, 2019 3:54 pm

serge_girard wrote:
Tue Feb 19, 2019 3:43 pm
Jair,

Missing /php/mysql.php AND themes/desktop.css !



Serge
So I need an example with mariadb I do not use php, how to connect to mysql with mariadb ?, can I create the php file manually and add in my application does it work or not?
Jair Pinho
HMG ALTA REVOLUÇÃO xBASE
HMG xBASE REVOLUTION HIGH
http://www.hmgforum.com.br

User avatar
serge_girard
Posts: 2277
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Has thanked: 532 times
Been thanked: 114 times
Contact:

Post by serge_girard » Tue Feb 19, 2019 5:49 pm

Jair,

In function MySQLBrowse you use: xmlHttp.open( "POST" , "/php/mysql.php" , false ) ;
This PHP file will do all the work. You will have to create it yourself!

It will be something like this:

Code: Select all

<?php
		
	$db = mysqli_connect( '127.0.0.1', 'root', '');  // your parameters!!
	if( ! $db ) :
		die( mysql_error() )	;
	endif;

	if( ! mysqli_select_db($db, 'bk')):
		die( mysql_error() );
	endif;
	
	$query = mysqli_query( $db, "select * from " );  / your parameters!!
	if( !$query ) :
		die("error SQL");
	endif;
	
	$table = array();
	while( $row = mysqli_fetch_array( $query, MYSQLI_NUM ) ):
		$table[] = $row;
	endwhile;

	$string	= json_encode( $table );
	mysqli_free_result( $query );
	mysqli_close($db);

	echo $string;
?>
Serge

Post Reply