•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 375,199 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,127 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 425 | Replies: 3 | Solved
![]() |
•
•
Join Date: Jan 2008
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 0
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in C:\xampp\htdocs\xampp\display.php on line 5
Connection Failed:
php is working fine, ran other simple php scripts...
but this is the error when i connect to a ms access db
the dsn exists and i have selected a db which has the table clients_online and other fields such as ip and mac exist
Connection Failed:
php is working fine, ran other simple php scripts...
but this is the error when i connect to a ms access db
php Syntax (Toggle Plain Text)
<html> <body> <?php $conn=odbc_connect("DB",'',''); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * FROM customers"; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>IP</th>"; echo "<th>MAC</th></tr>"; while (odbc_fetch_row($rs)) { $name=odbc_result($rs,"ip"); $macname=odbc_result($rs,"mac"); echo "<tr><td>$name</td>"; echo "<td>$macname</td></tr>"; } odbc_close($conn); echo "</table>"; ?> </body> </html>
the dsn exists and i have selected a db which has the table clients_online and other fields such as ip and mac exist
Last edited by peter_budo : Apr 26th, 2008 at 7:20 am. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Feb 2007
Location: St. Vincent and the Grenadines, Caribbean
Posts: 906
Reputation:
Rep Power: 3
Solved Threads: 38
•
•
Join Date: Jan 2008
Posts: 26
Reputation:
Rep Power: 1
Solved Threads: 0
oh thanks, i changed it to a system dsn now...
but i get this error msg
Warning: odbc_connect() [function.odbc-connect]: SQL error: Failed to fetch error message, SQL state HY000 in SQLConnect in C:\xampp\htdocs\xampp\display.php on line 5
Connection Failed:
program being this
but i get this error msg
Warning: odbc_connect() [function.odbc-connect]: SQL error: Failed to fetch error message, SQL state HY000 in SQLConnect in C:\xampp\htdocs\xampp\display.php on line 5
Connection Failed:
program being this
php Syntax (Toggle Plain Text)
<html> <body> <?php $conn=odbc_connect('data','',''); if (!$conn) {exit("Connection Failed: " . $conn);} $sql="SELECT * FROM clients_online"; $rs=odbc_exec($conn,$sql); if (!$rs) {exit("Error in SQL");} echo "<table><tr>"; echo "<th>ip</th>"; echo "<th>mac</th></tr>"; while (odbc_fetch_row($rs)) { $compname=odbc_result($rs,"ip"); $conname=odbc_result($rs,"mac"); echo "<tr><td>$compname</td>"; echo "<td>$conname</td></tr>"; } odbc_close($conn); echo "</table>"; ?> </body> </html>
Last edited by peter_budo : Apr 26th, 2008 at 7:20 am. Reason: Keep It Organized - please use [code] tags
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: uploading iamges to server
- Next Thread: Pull Data from External Website


Linear Mode