Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]
Print
Topic: Access Data base  (Read 1372 times)
« on: March 17, 2005, 08:23:27 AM »
Junior Member
goamaster Offline
Junior Member
Newbie

View Profile
*
Posts: 4



I am trying to access a access data base with PHP, but it is not possible. The error that happens is:
Fatal error: Call to undefined function: odbc_connect() in /home/freehost/t35.com/g/o/goamaster/access.php on line 2.

I don't know if the  problem is with permission for free acounts or the problem is with the PHP code.

This is the PHP code that i am trying to connect:

<?
$con = odbc_connect("access","","") or die("Erro na conexão com o Database");
$sql = odbc_exec($con,"SELECT * FROM tb_clientes");
$i=0;
while(odbc_fetch_row($sql)) {
    $i++;
    echo odbc_result($sql,"id");
    echo odbc_result($sql,"nome");
    echo odbc_result($sql,"endereco");
    echo odbc_result($sql,"email");
    echo odbc_result($sql,"telefone");
    echo "<br>";
}
?>

If someone can help me i will be thank.

Diego
Report to moderator   Logged

 
« Reply #1 on: March 17, 2005, 08:25:26 AM »
Junior Member
goamaster Offline
Junior Member
Newbie

View Profile
*
Posts: 4



I am trying to access a access data base with PHP, but it is not possible. The error that happens is:
Fatal error: Call to undefined function: odbc_connect() in /home/freehost/t35.com/g/o/goamaster/access.php on line 2.

I don't know if the  problem is with permission for free acounts or the problem is with the PHP code.

This is the PHP code that i am trying to connect:

<?
$con = odbc_connect("access","","") or die("Erro na conexão com o Database");
$sql = odbc_exec($con,"SELECT * FROM tb_clientes");
$i=0;
while(odbc_fetch_row($sql)) {
    $i++;
    echo odbc_result($sql,"id");
    echo odbc_result($sql,"nome");
    echo odbc_result($sql,"endereco");
    echo odbc_result($sql,"email");
    echo odbc_result($sql,"telefone");
    echo "<br>";
}
?>

If someone can help me i will be thank.

:: Goamaster ::
« Last Edit: March 17, 2005, 08:27:59 AM by goamaster » Report to moderator   Logged
« Reply #2 on: March 17, 2005, 10:45:57 AM »
Most Handsome Member
Incoherent Offline
Member
Member

View Profile WWW
***
Posts: 103



free service doesnt offer sql. It supports PHP but not anything else. You need to get a remote sql host.
Report to moderator   Logged

 
Pages: [1]
Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC