dazz_club Posted April 16, 2009 Share Posted April 16, 2009 Hi Guys, I have updated my latest version of PHP to 5.2.9 as I am about to upload my project to a host that uses that version. So i thought it be best to test the site locally as there could be some issuse..... When i went to the site i got a notice (i have error_reporting(E_ALL) )saying ------------------------------------------------------------------------------------ Notice: Constant DB_USER already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 9 Notice: Constant DB_PASSWORD already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 10 Notice: Constant DB_HOST already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 11 Notice: Constant DB_NAME already defined in C:\wamp\www\hallcrest\includes\mysqli_connect.php on line 12 ------------------------------------------------------------------------------------ This never happened with the other php version i used, 5.2.1... Any help would be greatly appreicated... Thanks Quote Link to comment https://forums.phpfreaks.com/topic/154350-solved-upgrade-my-php-version-from-521-to-529/ Share on other sites More sharing options...
ober Posted April 16, 2009 Share Posted April 16, 2009 You can't redefine a constant.... so ... don't do that? It's a pretty straight forward issue. If you want to ignore it, turn off error reporting. Quote Link to comment https://forums.phpfreaks.com/topic/154350-solved-upgrade-my-php-version-from-521-to-529/#findComment-811449 Share on other sites More sharing options...
dazz_club Posted April 16, 2009 Author Share Posted April 16, 2009 Hi, Thanks for getting back to me...When i removed error_reporting the problem was still there... What i done sort this out was to comment out the DEFINEs in my script like this; --------------------------------------- //DEFINE('DB_USER', 'root'); //DEFINE('DB_PASSWORD', 'xxxx'); //DEFINE('DB_HOST', 'xxxx'); //DEFINE('DB_NAME', 'xxxx'); --------------------------------------- Why wasnt this a problem with the other php version?? Whats happneded now is that some of my functions display this warning... ------------------------------------------------------------- Warning: mysqli_error() expects exactly 1 parameter, 0 given in ------------------------------------------------------------- function function InTheNews() { global $dbc; $query = "SELECT id,title, content,date FROM news_headlines ORDER BY id"; $result = mysqli_query ($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query"); while ($row = mysqli_fetch_array($result)) //need to format the date on this function { //get NewsID echo '<div class="headline"> <a href="in_the_news.php?headlines='.$row['id'].'">'.$row['title'].'</a> <span class="date_of_article">'.date("m.d.y",strtotime($row['date'])).'</span> <p>'.$row['content'].'</p> </div> '; } } again, these problems arised when i updated my php version. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/154350-solved-upgrade-my-php-version-from-521-to-529/#findComment-811461 Share on other sites More sharing options...
PFMaBiSmAd Posted April 16, 2009 Share Posted April 16, 2009 This has nothing to do with the php version. Your code always had those problems but they were simply not being displayed. Either the error_reporting setting or the display_errors setting were causing the errors to be hidden. Quote Link to comment https://forums.phpfreaks.com/topic/154350-solved-upgrade-my-php-version-from-521-to-529/#findComment-811468 Share on other sites More sharing options...
dazz_club Posted April 16, 2009 Author Share Posted April 16, 2009 ...ok thank you for letting me know and thank you guys for all your help, very much appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/154350-solved-upgrade-my-php-version-from-521-to-529/#findComment-811497 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.