Treval Posted March 7, 2007 Share Posted March 7, 2007 Ok guys what are the steps I have to do in order to setup MySQL with PHP? I read on here that you guys set values in php.ini and I don't think I did that. I got Apache running too and I'm on Wnidows XP Pro. I probably have to add lines to httpd.conf concerning MySQL? Which could explain why all my PHP scripts that try to connect to MySQL are displaying a blank page.. I don't know the reason yet. I used default codes from google to connect. Here's one: <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error connecting to mysql'); $dbname = 'petstore'; mysql_select_db($dbname); ?> Any help is greatly appreciated. Treval Quote Link to comment https://forums.phpfreaks.com/topic/41606-solved-php-not-recognizing-mysql/ Share on other sites More sharing options...
fenway Posted March 7, 2007 Share Posted March 7, 2007 There's a sticky in the PHP help forum about making sure the mysqli extension is properly configured. Quote Link to comment https://forums.phpfreaks.com/topic/41606-solved-php-not-recognizing-mysql/#findComment-202019 Share on other sites More sharing options...
wildteen88 Posted March 8, 2007 Share Posted March 8, 2007 Yes please read the Sticky titled Call to undefined function mysql_connect() in the PHP Help forum or the PHP Installation forum. Also it is recommended to set error_reporting to E_ALL in the php.ini whilst you are learning/developing your scripts. Before you change it make sure that display_errors is set to On in the php.ini too. That way if any errors crop up it will show you errors as to why rather than getting an unhelpful blank page. Also any changes you make to the php.ini make sure you save it and restart Apache. Quote Link to comment https://forums.phpfreaks.com/topic/41606-solved-php-not-recognizing-mysql/#findComment-202810 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.