xkyogre Posted June 22, 2007 Share Posted June 22, 2007 Whenever I use a mysqli_connect() function in my programs the browser goes blank but when iI take away that function everything else works perfectly. Why is this happening? How do I solve it Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 22, 2007 Share Posted June 22, 2007 Check for errors and post code. Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 22, 2007 Share Posted June 22, 2007 Whenever I use a mysqli_connect() function in my programs the browser goes blank but when iI take away that function everything else works perfectly. Why is this happening? How do I solve it Add the following two lines of code at the top of the page which gives a blank page: display_errors('1'); error_reporting(E_ALL); Â Retest. Do you get any error messages now? If you do post all errors here in full. Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 23, 2007 Author Share Posted June 23, 2007 The browser window still stays blank when you type in http://localhost/Crime.php which is the directory of the file. I tried to add display_errors('1'); error_reporting(E_ALL); but nothing changed. Any more suggestions??? Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 23, 2007 Share Posted June 23, 2007 Try checking mysqli_error and mysqli_connect_error() Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 23, 2007 Author Share Posted June 23, 2007 The screen goes blank even if IÂ make a new document with just mysqli_connect_error() in it. However, if I put phpinfo() it works fine. I think its the mysqli functions but I configured php as all the books and tutorials told me. Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 23, 2007 Share Posted June 23, 2007 Is there a mysqli section in the phpinfo output? Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 24, 2007 Author Share Posted June 24, 2007 No there isn't. Should there be one? Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 24, 2007 Share Posted June 24, 2007 There is in mine. I wonder why you're not getting any errors such as "function not found" or something. It looks like you need to install mysqli Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 26, 2007 Author Share Posted June 26, 2007 i done what it said on the link but still nothing has changed Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 26, 2007 Share Posted June 26, 2007 Is it enabled in php.ini? Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 26, 2007 Author Share Posted June 26, 2007 Yes but it isn't in safe mode. Could that be the cause of the problem? Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 26, 2007 Share Posted June 26, 2007 You mean PHP isn't running in safe mode? I don't think that would cause it.  What OS are you running PHP on? Can you post your connection code? Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 27, 2007 Author Share Posted June 27, 2007 Microsoft windows 2000 sp4 whot do you mean connection code??? The mysql tcp port is 3306 Quote Link to comment Share on other sites More sharing options...
per1os Posted June 27, 2007 Share Posted June 27, 2007 What version of PHP are you running? mysqli is only supported for PHP 5 Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 27, 2007 Share Posted June 27, 2007 whot do you mean connection code???  I mean the code you are using to connect that is failing.  (I didn't know about requiring PHP 5.0+. That very well may be it.) Quote Link to comment Share on other sites More sharing options...
per1os Posted June 27, 2007 Share Posted June 27, 2007 mysqli_connect,  (PHP 5)  mysqli_connect, mysqli->__construct() — Open a new connection to the MySQL server Description  http://us.php.net/manual/en/function.mysqli-connect.php  Yep only PHP 5 can use mysqli. Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 28, 2007 Author Share Posted June 28, 2007 I am using php 5. What does the code above do Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 28, 2007 Share Posted June 28, 2007 Can you post the code surrounding and including your failed call to mysqli_connect(), please? Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 29, 2007 Author Share Posted June 29, 2007 Thank you using the code above it solved my problem. The only thing is how do I say that this topic is solved? Quote Link to comment Share on other sites More sharing options...
Wildbug Posted June 29, 2007 Share Posted June 29, 2007 There's a link around the bottom of the page somewhere that will mark the topic solved. Quote Link to comment Share on other sites More sharing options...
xkyogre Posted June 29, 2007 Author Share Posted June 29, 2007 Thanks again Quote Link to comment 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.