Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- require ("include/db.inc.php");
- $user_id = 1;
- $search = $db->prepare("SELECT `searched` FROM `search` WHERE `user_id` =:user_id");
- $search->bindValue(':user_id', $user_id, PDO::PARAM_INT);
- $search->execute();
- $result = $search->fetch(PDO::FETCH_ASSOC);
- echo "<pre>", print_r($result), "</pre><br>";
- if ($result['searched'] >= 10){
- echo 'you have reached your search limit for this month<br>';
- }
- $addsearch = $db->prepare("UPDATE `evomap`.`search` SET `searched` = :searched + 1 WHERE `search`.`id` =:user_id;");
- $addsearch->bindValue(':user_id', $user_id, PDO::PARAM_INT);
- $addsearch->bindValue(':searched', $result['searched'], PDO::PARAM_INT);
- $addsearch->execute();
- echo 'DEBUGGING';
- echo'<br><pre>', print_r($db->errorInfo()), '<pre>';
- echo "Number of results: ", $search->rowCount(), "<br>";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement