Page 5 of 5

Re: HMGSCRIPT R42

Posted: Tue Feb 19, 2019 10:09 am
by serge_girard
Jair,

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

Serge

Re: HMGSCRIPT R42

Posted: Tue Feb 19, 2019 12:20 pm
by jairpinho
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

Re: HMGSCRIPT R42

Posted: Tue Feb 19, 2019 3:43 pm
by serge_girard
Jair,

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

Serge

Re: HMGSCRIPT R42

Posted: Tue Feb 19, 2019 3:54 pm
by jairpinho
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?

Re: HMGSCRIPT R42

Posted: Tue Feb 19, 2019 5:49 pm
by serge_girard
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