Note that there are some explanatory texts on larger screens.

plurals
  1. POSearching the table to confirm then updating a table row
    primarykey
    data
    text
    <p>hate to ask because I've been trying to do all of this on my own but it just will not work, i've searched everywhere and it says I'm doing it correctly</p> <pre><code>include "db.inc.php"; $ip = $_SERVER['REMOTE_ADDR']; $ip = mysql_real_escape_string($ip); $getcount = mysql_query("SELECT * FROM captcha WHERE ip='$ip'"); $resultc = mysql_result($getcount, 0, count); if($resultc !== "5"){ #header("Location: index.php"); echo "don't work"; }else if($resultc == "5"){ if (!isset($post)){ $_SESSION['secure'] = substr(str_shuffle($charset), 0, 6); }else{ if ($_SESSION['secure']==$post){ mysql_query("UPDATE captcha SET count=0 WHERE ip='$ip'"); }else{ $error_message = "Incorrect, Try again"; $_SESSION['secure'] = substr(str_shuffle($charset), 0, 6); } } } </code></pre> <p>its searching the table for the matching ip, getting the number in count, if it does not = count it will echo "don't work" if it does it will do the captcha checks, everything in captcha check works except for the UPDATE</p> <p>What i'm trying to do here is, I've made a custom Captcha which works, what i need to do now is when a users count is 5 which will add 1 to the current number everytime they successfully shrink a URL, I need it to check the db if it is not 5 I do not want them to have access to the captcha page so I need them to be redirected to the index page, if it is 5 it will go through the captcha which works, but I need to reset the count back to 0 after they enter the captcha code correctly, but it will not update the row.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload