Jump to content

Warning: mysqli_error() expects exactly 1 parameter, 0 given


Go to solution Solved by Maq,

Recommended Posts

Hi all,

 

I've got a function which selects some new items, but i am running into some bother

 

the warning is:Warning: mysqli_error() expects exactly 1 parameter, 0...

 

the line it specifies is;

$result = mysqli_query($dbc, $query)or die(mysqli_error() . "<p>With query:<br>$query");

 

Here is the whole 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>
        
';
}
}

 

Any pointers on this at all will be very helpful :)

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.