PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > need for connecting the db in php
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
need for connecting the db in php

Réponse
 
LinkBack Outils de la discussion
Vieux 26/04/2008, 14h05   #1
BigZero
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut need for connecting the db in php

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 me to slove this problem

Thanks
Vijay
  Réponse avec citation
Vieux 26/04/2008, 14h13   #2
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: need for connecting the db in php

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 me to slove this problem
>
> Thanks
> Vijay
>


Which is line 25?

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

  Réponse avec citation
Vieux 26/04/2008, 14h37   #3
Roger
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: need for connecting the db in php

On Apr 26, 7:05am, BigZero <vijaymajagaon...@gmail.com> 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 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");
  Réponse avec citation
Vieux 26/04/2008, 14h49   #4
BigZero
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: need for connecting the db in php

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


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h25.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 1,10370 seconds with 12 queries