Blog

'; $username = "aceeng_Ace"; $password = "Ace@123"; $hostname = "localhost"; $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); $dbName = "aceeng_AceEngineerNew"; $selected = mysql_select_db($dbName) or die("Could not select OilAndGas"); $start = 0; $limit = 5; if (isset($_GET['id'])) { $id = $_GET['id']; $start = ($id - 1) * $limit; } if (!isset($id)) { $id = 1; } $query2 = mysql_query("SELECT * FROM `ace_blog` LIMIT $start, $limit"); $result1 = ""; $menu= ""; $CommentBox= ""; while ($query3 = mysql_fetch_array($query2)) { // $result1= $result1.'


' . $query3['Heading'] . '

'; $result1= $result1.'

' . $query3['Heading'] . '

'; //table comment box // $CommentBox = '
Email
'; // $CommentBox = $CommentBox.'
'; // // if($query3['BlogComment'] !=""){ $CommentBox = '
'.$query3['BlogComment']; } else{ // $CommentBox = '
'; // $CommentBox = $CommentBox.'
Email :
Comment :

' ; $CommentBox = '
'; $CommentBox = $CommentBox.'
Email :
Comment :

' ; } $result1= $result1.'

' . stripslashes($query3['BlogContent']) . '

' .$CommentBox.'
'; $menu = $menu.'
  • ' . $query3['Heading'] . '
  • '; } echo $result1.'
    '; $menuRes= '

    Categories

      ' . $menu. '
    '; echo $menuRes; echo '
    '; $rows = mysql_num_rows(mysql_query("select * from `ace_blog`")); $total = ceil($rows / $limit); echo '
      '; for ($i = 1; $i <= $total; $i++) { if ($i == $id) { echo "
    • " . $i . "
    • "; } else { echo "
    • " . $i . "
    • "; } } echo '
    '; echo "
    "; if ($id > 1) { echo "PREVIOUS"; } if ($id != $total) { echo "NEXT"; } echo "
    "; mysql_close(); ?>
    Get in Touch