connect to mysql with php

Pat kilgore kilgorepat at hotmail.com
Fri Jan 19 08:48:10 MST 2007


Thanks but none of that code works.
I have the die statement but it doesn't output anything.
After the first line of the connect statement no more code will execute.
Also,no html that comes after that statement in the php page is returned to 
the browser.
Maybe related is fact that errors are not being returned to browser, even 
though they are enabled in php.ini

Pat



----Original Message Follows----
From: Derick Centeno <aguilarojo at verizon.net>
Reply-To: Discussion List for New Yellow Dog Linux 
Users<yellowdog-newbie at lists.terrasoftsolutions.com>
To: Discussion List for New Yellow Dog Linux 
Users<yellowdog-newbie at lists.terrasoftsolutions.com>
Subject: Re: connect to mysql with php
Date: Fri, 19 Jan 2007 10:29:05 -0500

Hi Pat:

Here are some links addressing your question which may help:

1.  http://www.php-mysql-tutorial.com/connect-to-mysql-using-php.php

2.  http://php.about.com/od/phpwithmysql/qt/mysql_connect.htm

3.  http://www.siteground.com/tutorials/php-mysql/php_mysql_connection.htm

According to link 1, you may have left out an "n" and it may be a good
idea to follow the example and have an error statement embedded
reminding you when something breaks.

Applying the example in link 1 to your code the correction could be:

$conn = mysql_connect ("localhost", "root") or die ('Error connecting to
mysql');

Good Luck ... Derick.
------------------------------------------------------------------------


Pat kilgore wrote:
 > I have YDL 5.0 installed on an iBook installed as a server with
 > apache, php, and mysql selected as installed services.
 > MySQL is running and from command line I have created database, table
 > and data.
 > Problem is connecting to mysql with php.
 > The line
 > $con = mysql_connect("localhost","root");
 > in php page breaks the script and nothing after this line will execute.
 > php functions run ok.
 >
 > Pat
 >
 > _________________________________________________________________
 > Type your favorite song.  Get a customized station.  Try MSN Radio
 > powered by Pandora. http://radio.msn.com/?icid=T002MSN03A07001
 >
 > ------------------------------------------------------------------------
 >
 > _______________________________________________
 > yellowdog-newbie mailing list
 > yellowdog-newbie at lists.terrasoftsolutions.com
 > http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-newbie
 >
_______________________________________________
yellowdog-newbie mailing list
yellowdog-newbie at lists.terrasoftsolutions.com
http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-newbie

_________________________________________________________________
The MSN Entertainment Guide to Golden Globes is here.  Get all the scoop. 
http://tv.msn.com/tv/globes2007/?icid=nctagline2



More information about the yellowdog-newbie mailing list