List:General Discussion« Previous MessageNext Message »
From:Eric Bergen Date:March 8 2005 6:00pm
Subject:Re: php - mysql connection
View as plain text  
mysql_connect('localhost', 'my_user', 'my_pass')
 or die(mysql_error()):


On Tue, 8 Mar 2005 11:28:47 -0600, Jay Blanchard
<jay.blanchard@stripped> wrote:
> [snip]
> I am a new mysql user.  I installed a MySQL, PHP and Apache on my
> computer with Windows XP.
> All my php scripts run fine unless I try to connect to mysql
> 
> <?php
> echo "start here";
> $a = mysql_connect("localhost", "test", "test");
> echo $a;
> echo "stop here";
> ?>
> 
> I don't get any response even error message and page source looks like
> 
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
> <title>Untitled Document</title>
> </head>
> <body>
> start here
> 
> I guess that I am doing something very stupid - still could anybody help
> me?
> [/snip]
> 
> Try this...
> 
> if(!($dbconnect = mysql_connect("localhost", "test", "test"))){
>         echo mysql_error() . "\n";
>         exit();
> }
> 
> It will give you a more descriptive error if there is one
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:    http://lists.mysql.com/mysql?unsub=1
> 
> 


-- 
Eric Bergen
eric.bergen@stripped
http://www.ebergen.net
Thread
php - mysql connectionStar Smile Center for Esthetic Dentistry8 Mar
RE: php - mysql connectionJay Blanchard8 Mar
  • Re: php - mysql connectionEric Bergen8 Mar