Point my code to a remote db
Posted: Tue Apr 01, 2008 10:26 am
Hi, My company has this site and I copied all the php code to my PC to make a few tests.
I installed appserv, created a db in phpmyadmin, imported the tables from the original db and some data to (not all because it's too much).
Here started my problems. The site in my local host has some character issues so it make querys looking for tables with these special characters. So, instead of a list of lines from my tables I get this in my page:
I don't know if the problem is that I imported a db from linux and trying to use it in windows, or maybe the problem is not in the db but in the query generated in the site. Some help in this would be great.
One other option is to point my code to the original, remote db. I have this php code:
what should I change here (or somewhere else) to get the data from the remote db?
TIA for any help,
João
I installed appserv, created a db in phpmyadmin, imported the tables from the original db and some data to (not all because it's too much).
Here started my problems. The site in my local host has some character issues so it make querys looking for tables with these special characters. So, instead of a list of lines from my tables I get this in my page:
Code: Select all
SELECT noticias.data™Data™bd™editar.php?tipo=$tipo&id=valor_id&filtro=$filtro™™
FROM noticias™™id™
WHERE 1=1 AND tipo=1
Error: noticias™™id™' doesn't existOne other option is to point my code to the original, remote db. I have this php code:
Code: Select all
session_start();
// DB do Site
//***********************************
Class config {
var $db;
var $login;
var $senha;
var $odbc;
var $driver;
var $servidor;
Function config () {
$this->db = "db";
$this->login = "user";
$this->senha = "pwd";
$this->odbc = "";
$this->driver = "";
$this->servidor = "localhost";
}
}
TIA for any help,
João