Connect to the database

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
josecnp1
User
Posts: 73

Connect to the database

Post 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 = '*')
{ ...........


scs
User
Posts: 694

Post by scs »

open the
ewcfg11.php

and look for
// Database connection info


josecnp1
User
Posts: 73

Post 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.


scs
User
Posts: 694

Post 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.


Post Reply