By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,110 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

need help for connecting the db in php

P: n/a
hello i m new to php
i m working on project that has interface with simple html and php i m
thinking to use
i got some problem with the connecting to DB here is the code for
connecting db

$db = "Snmp_Dba";
// $connection_id = odbc_connect_custom($db);
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db", "ADODB.Connection", "", "SQL_CUR_USE_ODBC");
// $query = "SELECT * FROM System_Master";
//$result_id = odbc_exec($connection_id,$query);
$result = odbc_tables($db_connection);
while (odbc_fetch_row($result)) {
if(odbc_result($result,"TABLE_TYPE")=="TABLE") {
echo "<br />" . odbc_result($result,"TABLE_NAME");
?>
by doing this i got error in ie as follows

Parse error: parse error in c:\program files\easyphp1-8\www\search.php
on line 25

any body help me to slove this problem

Thanks
Vijay
Jun 2 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
BigZero wrote:
hello i m new to php
i m working on project that has interface with simple html and php i m
thinking to use
i got some problem with the connecting to DB here is the code for
connecting db

$db = "Snmp_Dba";
// $connection_id = odbc_connect_custom($db);
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db", "ADODB.Connection", "", "SQL_CUR_USE_ODBC");
// $query = "SELECT * FROM System_Master";
//$result_id = odbc_exec($connection_id,$query);
$result = odbc_tables($db_connection);
while (odbc_fetch_row($result)) {
if(odbc_result($result,"TABLE_TYPE")=="TABLE") {
echo "<br />" . odbc_result($result,"TABLE_NAME");
?>
by doing this i got error in ie as follows

Parse error: parse error in c:\program files\easyphp1-8\www\search.php
on line 25

any body help me to slove this problem

Thanks
Vijay
Which is line 25?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jun 2 '08 #2

P: n/a
On Apr 26, 7:05*am, BigZero <vijaymajagaon...@gmail.comwrote:
hello i m new to php
i m working on project that has interface with simple html and php i m
thinking to use
i got some problem with the connecting to DB here is the code for
connecting db

$db = "Snmp_Dba";
* // *$connection_id = odbc_connect_custom($db);
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db", "ADODB.Connection", "", "SQL_CUR_USE_ODBC");
* *// $query * * * * = "SELECT * FROM System_Master";
* * //$result_id * * = odbc_exec($connection_id,$query);
$result = odbc_tables($db_connection);
while (odbc_fetch_row($result)) {
* * if(odbc_result($result,"TABLE_TYPE")=="TABLE") {
* * * * echo "<br />" . odbc_result($result,"TABLE_NAME");
?>

by doing this i got error in ie as follows

Parse error: parse error in c:\program files\easyphp1-8\www\search.php
on line 25

any body help me to slove this problem

Thanks
Vijay
I think this
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=$db", "ADODB.Connection", "", "SQL_CUR_USE_ODBC");

needs to be this
$db_connection = odbc_connect("DRIVER={Microsoft Access Driver
(*.mdb)}; DBQ=" . $db, "ADODB.Connection", "", "SQL_CUR_USE_ODBC");
Jun 2 '08 #3

P: n/a
Thanks
i got solution for that,
i chabged UserDsn to SystemDSN setting in control panel

and all did change in code is
$con = odbc_connect('MSAccessDriver','','');

any way thanks
Regards
Vijay
Jun 2 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.