RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

odbc-connect error--urgent

Join Date: Jan 2008
Posts: 26
Reputation: abdulraqeeb33 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Sponsor
abdulraqeeb33 abdulraqeeb33 is offline Offline
Light Poster

Re: odbc-connect error--urgent

  #3  
Apr 25th, 2008
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
  1. <html>
  2. <body>
  3.  
  4. <?php
  5. $conn=odbc_connect('data','','');
  6. if (!$conn)
  7. {exit("Connection Failed: " . $conn);}
  8. $sql="SELECT * FROM clients_online";
  9. $rs=odbc_exec($conn,$sql);
  10. if (!$rs)
  11. {exit("Error in SQL");}
  12. echo "<table><tr>";
  13. echo "<th>ip</th>";
  14. echo "<th>mac</th></tr>";
  15. while (odbc_fetch_row($rs))
  16. {
  17. $compname=odbc_result($rs,"ip");
  18. $conname=odbc_result($rs,"mac");
  19. echo "<tr><td>$compname</td>";
  20. echo "<td>$conname</td></tr>";
  21. }
  22. odbc_close($conn);
  23. echo "</table>";
  24. ?>
  25.  
  26. </body>
  27. </html>



Originally Posted by scru View Post
Are you sure it is a system dsn and not a user dsn? You must you the system tab in ODBC in the Administrative Tools to set up a system dsn.

HTH
Last edited by peter_budo : Apr 26th, 2008 at 8:20 am. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:17 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC