Jump to content

checking values of database if its already viewed


dvayne

Recommended Posts

You could simply insert the value in to a table called view or something... the view table would contain the view_number.

 

$number = $_GET['p'];

if (!is_numeric($number)) {
echo "Not a valid number!";
exit;
}

$check = mysql_query("SELECT view_number FROM `table` WHERE `view_number`='$number'");
$query = mysql_num_rows($check);

if ($query > 0) {
echo "This page has already been viewed!";
}
?>

You could simply insert the value in to a table called view or something... the view table would contain the view_number.

 

$number = $_GET['p'];

if (!is_numeric($number)) {
echo "Not a valid number!";
exit;
}

$check = mysql_query("SELECT view_number FROM `table` WHERE `view_number`='$number'");
$query = mysql_num_rows($check);

if ($query > 0) {
echo "This page has already been viewed!";
}
?>

thanks, please explain your code...

i'm newbie in php

Archived

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.