List:General Discussion« Previous MessageNext Message »
From:Martin Ramsch Date:October 7 1999 4:48am
Subject:Re: PHP to MySQL
View as plain text  
On Tue, 1999-10-05 14:17:05 -0600, Shawn Blazier wrote:
> My problem is that I can't connect to MySQL via a PHP script.
> I tried:
> <?
> mysql_connect("localhost", "username", "password")
> 
> ?>
> Is there a way to debug this?

In many cases it helps to watch the error codes!

<?php
   $cid = mysql_connect("localhost", "username", "password")
     or die("Can't connect : error ".mysql_errno().": ".mysql_error());
   // ...
?>

Regards,
  Martin
-- 
Martin Ramsch <m.ramsch@stripped> <URL: http://home.pages.de/~ramsch/ >
PGP KeyID=0xE8EF4F75 FiPr=5244 5EF3 B0B1 3826  E4EC 8058 7B31 3AD7
Thread
PHP to MySQLShawn Blazier5 Oct
  • Re: PHP to MySQLJunster5 Oct
    • DBI:mysql Can't connect to local MySQL serverGregory McCann6 Oct
      • Re: DBI:mysql Can't connect to local MySQL serverThimble Smith6 Oct
        • Re: DBI:mysql Can't connect to local MySQL serverGregory McCann6 Oct
          • Re: DBI:mysql Can't connect to local MySQL serverThimble Smith6 Oct
  • Re: PHP to MySQLMartin Ramsch7 Oct
    • Re: PHP to MySQLPaul DuBois7 Oct