Jump to content

dachshund

Members
  • Posts

    312
  • Joined

  • Last visited

Posts posted by dachshund

  1. Hi,

     

    I'm just changing all my old PHP 5 code to PHP 7, which I'm very new to, and have come across some issues. The below code is giving this error: Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, boolean given in

     

    Any help much appreciated:

     

     
    $sql = "SELECT * FROM content WHERE `live` LIKE '0' AND `featured` LIKE '1'";
    $result = mysqli_query($con, $sql);
    while($rows=mysqli_fetch_assoc($result)){
     
    
  2. Hi,

     

    On our blog homepage we currently have 12 articles displayed. After 12 articles, I could like to add in an advert, followed by another 12 articles. I just wondered if there's an easy way to do this? Here's our current code:

     

     

    $oldarticles = 12 * $pagenumber - 12;
    $sql = "SELECT * FROM content WHERE `live` LIKE '0' AND '$today' > `date` ORDER BY date DESC LIMIT $oldarticles,12";
    $result=mysql_query($sql);
    while($rows=mysql_fetch_array($result)){
    

     

    Thanks

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