Jump to content

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


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>


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

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • 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.