![]() |
Whats wrong with this PHP code? mysql_connect ("localhost", "nathan_userblog", ""); I've removed the password, but I get an error saying its depricated. It reads below - Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home1/nathan/public_html/Blog.php on line 2 How to I correct this? |
Re: Whats wrong with this PHP code? Try mysqli_connect |
Re: Whats wrong with this PHP code? would I have to insert the i ever time I mention mysql? |
Re: Whats wrong with this PHP code? Its made no different, still shows an error. Any other ideas? |
Re: Whats wrong with this PHP code? Getting these errors now - Warning: mysqli_query() expects at least 2 parameters, 1 given in /home1/nathan/public_html/Blog.php on line 50 Line 50 - $sql = mysqli_query("SELECT * FROM blog1data ORDER BY id DESC"); Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home1/nathan/public_html/Blog.php on line 51 Line 51 - while ($row = mysqli_fetch_array ($mysqli_result, $sql)){ |
Re: Whats wrong with this PHP code? See this page to learn how to use PHP mysqli library: PHP mysqli_fetch_array() Function Your questions are answered there, just have a look at the code and compare it to what you're doing. |
Re: Whats wrong with this PHP code? To show no errors or warnings type PHP Code: Code: Warning: mysqli_query() expects at least 2 parameters, 1 given in /home1/nathan/public_html/Blog.php on line 50Fix for line 50: PHP Code: PHP Code: PHP Code: |
Re: Whats wrong with this PHP code? Quote:
Im totally confused. |
Re: Whats wrong with this PHP code? Quote:
|
Re: Whats wrong with this PHP code? Just turn off error reporting, "deprecated" isn't an error itself. Did that code ever worked if so when did it stop? Maybe your problem is somewhere else . |
Re: Whats wrong with this PHP code? Change the PHP ini file to only report errors and ignore warnings. If you want you can put @ in front of php commands like mysql connect to prevent it outputting those kind of warnings. |
| All times are GMT -6. The time now is 12:59 PM. |