•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 427,731 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 3,898 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: 711 | 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
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
Other Threads in the PHP Forum
- Previous Thread: uploading iamges to server
- Next Thread: Pull Data from External Website



Threaded Mode