dazz_club Posted April 16, 2009 Share Posted April 16, 2009 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 Link to comment https://forums.phpfreaks.com/topic/154373-warning-mysqli_error-expects-exactly-1-parameter-0-given/ Share on other sites More sharing options...
Maq Posted April 16, 2009 Share Posted April 16, 2009 Procedural style: string mysqli_error ( mysqli $link ) You need to give it the connection link. Link to comment https://forums.phpfreaks.com/topic/154373-warning-mysqli_error-expects-exactly-1-parameter-0-given/#findComment-811616 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.