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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/ Share on other sites More sharing options...
Wildbug Posted June 22, 2007 Share Posted June 22, 2007 Check for errors and post code. Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280179 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. Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280255 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??? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280876 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() Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280888 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. Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280897 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-280911 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-281282 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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-281287 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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-283068 Share on other sites More sharing options...
Wildbug Posted June 26, 2007 Share Posted June 26, 2007 Is it enabled in php.ini? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-283115 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-283304 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-283314 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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-284119 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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-284123 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.) Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-284194 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. Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-284203 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 Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-285109 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-285123 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? Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-285889 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. Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-285893 Share on other sites More sharing options...
xkyogre Posted June 29, 2007 Author Share Posted June 29, 2007 Thanks again Link to comment https://forums.phpfreaks.com/topic/56723-solved-help-mysqli_connect-problem-different-to-the-one-in-the-faq-section/#findComment-286112 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.