Page 1 of 1
Connect to the database
Posted: Fri Dec 12, 2014 6:20 pm
by josecnp1
I created a function to make a backup of the database.
But I do not get it to work because I do not recognize variables to connect to the database
this is my code
<?php include_once "ewcfg10.php" ?>
<?php include_once "ewmysql10.php" ?>
<?php include_once "phpfn10.php" ?>
<?php include_once "propiedadesinfo.php" ?>
<?php include_once "userfn10.php" ?>
$host = "EW_CONN_HOST";
$user = "EW_CONN_USER";
$pass = "EW_CONN_PASS";
$name = "EW_CONN_DB";
function backup_tables($host,$user,$pass,$name,$tables = '*')
{ ...........
Re: Connect to the database
Posted: Fri Dec 12, 2014 8:47 pm
by scs
open the
ewcfg11.php
and look for
// Database connection info
Re: Connect to the database
Posted: Fri Dec 12, 2014 9:30 pm
by josecnp1
we already saw.
what I would like is to use the variable EW_CONN_HOST or EW_CONN_USER... correctly
I do not want to put my data base data directly.
I want to use the definitions of phpmaker
for example
in the function ....
$name = "EW_CONN_DB";
replace "EW_CONN_DB" by the value in ewcfg11.php which is: define("EW_CONN_DB", 'administracion', TRUE);
I tried with
$name = "EW_CONN_DB()";
$name = "$EW_CONN_DB";
$name = define("EW_CONN_DB")......
not if I have explained well.
Re: Connect to the database
Posted: Sun Dec 14, 2014 4:27 pm
by scs
I think you don't understand what is
$name = "EW_CONN_DB";
$name = EW_CONN_DB();
$name = $EW_CONN_DB;
Once you understand the concept, you know whats went wrong.