Jump to content

oz11

Members
  • Posts

    167
  • Joined

  • Last visited

Community Answers

  1. oz11's post in Details not showing second line... was marked as the answer   
    Came down to a  
    Take time with Franken code!
  2. oz11's post in Only shows on second refresh..? was marked as the answer   
    Fixed code:
    <?php include 'config.php'; $stmt = $pdo->prepare("SELECT count(*) FROM news WHERE reference=?"); $stmt->execute([$_GET['ref']]); $check_exist = $stmt->fetchColumn(); if($check_exist == 0){ echo "error not found"; exit(); } $user_ip=$_SERVER['REMOTE_ADDR']; $stmt = $pdo->prepare("SELECT count(*) FROM outgoing_count WHERE IP = ? AND news_reff = ?"); $stmt->execute([$user_ip, $_GET['ref']]); $count = $stmt->fetchColumn(); if($count == 0){ $sql = "INSERT INTO outgoing_count (IP, news_reff) VALUES (?,?)"; $stmt= $pdo->prepare($sql); $stmt->execute([$user_ip, $_GET['ref']]); $stmt = $pdo->prepare("SELECT count(*) FROM outgoing_count WHERE news_reff = ?"); $stmt->execute([ $_GET['ref']]); $count2 = $stmt->fetchColumn(); echo "Redirect. This page has been viewed ".$count2."times"; } else { $stmt = $pdo->prepare("SELECT count(*) FROM outgoing_count WHERE news_reff = ?"); $stmt->execute([$_GET['ref']]); $count3 = $stmt->fetchColumn(); echo "Redirect. This page has been viewed ".$count3."times"; //header('Location: http://google.com'); } ?> .. just needed time.
  3. oz11's post in Function not working (using LIKE and PDO) was marked as the answer   
    Changed 
    to
    and seems to work now. Thanks guys for being here.
×
×
  • 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.