connect to mysql with php - solution
Pat kilgore
kilgorepat at hotmail.com
Fri Jan 19 13:02:15 MST 2007
Problem resolved in two steps. I didn't realize Apache needed to be
restarted after turning on error reporting in php.ini and I needed to
install php-mysql. I assumed that would come with the distro. Now its just
simple perms to deal with.
----Original Message Follows----
From: "Pat kilgore" <kilgorepat at hotmail.com>
Reply-To: Discussion List for New Yellow Dog Linux
Users<yellowdog-newbie at lists.terrasoftsolutions.com>
To: yellowdog-newbie at lists.terrasoftsolutions.com
Subject: Re: connect to mysql with php
Date: Fri, 19 Jan 2007 10:48:10 -0500
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
_______________________________________________
yellowdog-newbie mailing list
yellowdog-newbie at lists.terrasoftsolutions.com
http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-newbie
_________________________________________________________________
Get in the mood for Valentine's Day. View photos, recipes and more on your
Live.com page.
http://www.live.com/?addTemplate=ValentinesDay&ocid=T001MSN30A0701
More information about the yellowdog-newbie
mailing list