glo_nm_conexao ... how does it work within code ?

Hi ,
I’m trying to make a blank application to download sql select into csv file.
At the beginning I have to declare the connection variable but I don’t want to declare it .
Is it possible to use that one defined into SC ?
I’ve tried this down here… without success
Thanks

//$conn = mysql_connect(“localhost”,“root”,"");

$conn = ‘[glo_nm_conexao]’;

mysql_select_db(“eos_b2bc”,$conn);

Ok . Solved like that

//$conn = ‘[glo_nm_conexao]’;
$server= [sc_glo_servidor];
$userdb =[sc_glo_usuario];
$userpwd = [sc_glo_senha];
$db = [sc_glo_banco];

//$conn = mysql_connect(“localhost”,“root”,"");
$conn = mysql_connect($server, $userdb , $userpwd);

Find the prep_conect function in your application and use xdebug to see what goes on. I dont know the details but I saw that this one should give you all the answers.
Somewhere in the main php you see a call to $this->prep_conect();
Also you could search for conectDB() you will see that does a connect. Here you see the Db object already beaing able to do Db->Execute so debugging that one might give
you the clues you need.

[QUOTE=giovannino;31399]Ok . Solved like that

//$conn = ‘[glo_nm_conexao]’;
$server= [sc_glo_servidor];
$userdb =[sc_glo_usuario];
$userpwd = [sc_glo_senha];
$db = [sc_glo_banco];

//$conn = mysql_connect(“localhost”,“root”,"");
$conn = mysql_connect($server, $userdb , $userpwd);[/QUOTE]

or you can create a SC database connection with sc_connection*
http://giudev.blogspot.com.es/2014/10/nuevas-macros-en-v8-para-manejo-de.html

EDITED

SOrry, in english: http://www.scriptcase.net/scriptcase-samples/tutoriais/systems/multiple_databases.php

Hi Giu.

I found your reply useful in order to try to build up a new temporary connection, but I have one more issue with it. I want to connect to MySQL and I followed exactly your instructions, but the connection doesn’t work. Server data is correct, but is it supposed to pass also the DB port? I haven’t found any parameter in your example and neighter in the macro manual how to pass the port. How you solved this?

Thanks for your advice