Jump to content

Recommended Posts

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

 

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

 

 

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.