Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>change it to this, it's an associate array. </p> <pre><code> if (mysql_num_rows($result) == 0 || $row['level'] &lt;= 119) </code></pre> <p>also if you $result1 query is returning 1 row, you don't need a while loop here.</p> <pre><code>while($row = mysql_fetch_array($result1)) { } </code></pre> <p>change it this</p> <pre><code>list($row) = mysql_fetch_array($result1); </code></pre> <p><strong>EDITED</strong></p> <pre><code>&lt;?php $user = 'test'; //dbuser $pass = 'test'; //dbpass $host = 'localhost'; //dbhost $name = 'zf'; //dbname $con = mysql_connect($host, $user, $pass); mysql_select_db($name, $con); $datetime = date('Y-m-d'); $ip = $_SERVER['REMOTE_ADDR']; if (isset($_POST['button'])) { $char_name = $_POST['CharName']; $result = mysql_query("SELECT `name`, `level` FROM `cq_user` WHERE `name` = '".$char_name."' AND UNIX_TIMESTAMP(lastvoted) &lt;= UNIX_TIMESTAMP('" . date('Y-m-d H:i:s', strtotime('-12 Hours')) . "')") or die(mysql_error()); list($name, $level) = mysql_fetch_array($result1); error_reporting(E_ALL); ini_set('display_errors', '1'); if (mysql_num_rows($result) == 0 || $level &lt;= 119) echo "This character does not exist, or you have entered the wrong name. Or you could be trying to cheat and have already voted. Or you are not level 120+."; else { mysql_query("UPDATE `cq_user` SET `emoney` = `emoney` + 100000, `lastvoted`='" . date('Y-m-d H:i:s') . "', `ip` = '".$ip."' WHERE `name` = '" . $char_name . "'") or die(mysql_error()); ?&gt; &lt;meta http-equiv="REFRESH" content="0;url=http://www.xtremetop100.com/in.php?site=1132303596"&gt;&lt;/HEAD&gt; &lt;?php } } ?&gt; </code></pre> <p>your html</p> <pre><code>&lt;form name="FORMNAME" action="submit.php" method="post"&gt; &lt;input type="text" name="CharName" /&gt; &lt;input type="submit" name="button" value="Submit" /&gt; &lt;/form&gt; </code></pre>
    singulars
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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