php mysql connection problem, just a blank screen

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
reson
Forum Newbie
Posts: 7
Joined: Sat Jun 30, 2007 8:06 pm

php mysql connection problem, just a blank screen

Post by reson »

Hi, I cannot get php to connect to mysql. They both work individually, but when I run the connection script I just get a blank screen. It's not my script, it must be something in the configuration. Has anybody had this problem, or seen it posted here before? Any help/ideas would be greatly appreciated. Thanks, Matt
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

We cannot help if we cannot see your code :wink:

Moved to PHP-Code.
tapas_bahirbag
Forum Newbie
Posts: 14
Joined: Sun Aug 06, 2006 6:54 am
Contact:

Post by tapas_bahirbag »

User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

Use a library like php adodb

Post by yacahuma »

If you are starting use a library like phpadodb. It is really easy to switch databases. Also it has cache and debug features. adodb is my personal favorite. Use it for many years. It is extremely easy to use and the documentation is excellent. Even Oracle recommends it.


http://adodb.sourceforge.net/

dont waste your time using calls like mssql_connect() you will regret it in the future. I least I did.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Code: Select all

<?php error_reporting(E_ALL); ini_set("display_errors", true); ?>
I'll bet 10 pence that you don't have the MySQL extension enabled in your PHP installation, so mysql_connect() is an undefined function causing a fatal error ;)
User avatar
idevlin
Forum Commoner
Posts: 78
Joined: Tue Jun 26, 2007 1:10 pm
Location: Cambridge, UK

Post by idevlin »

d11wtq wrote:

Code: Select all

<?php error_reporting(E_ALL); ini_set("display_errors", true); ?>
I'll bet 10 pence that you don't have the MySQL extension enabled in your PHP installation, so mysql_connect() is an undefined function causing a fatal error ;)
10 pence? You don't sound that confident! :D
reson
Forum Newbie
Posts: 7
Joined: Sat Jun 30, 2007 8:06 pm

got it

Post by reson »

It was my code, not my extensions (sorry d11wtq, but your 10 pence are out the window). But I couldn't tell what was going on until I set my error reporting to on and reset my system. THanks for all your comments!
Post Reply