PHP Getting data from mysql and then use it in different actions
<p>So I want to get some data from mysql and use it to create some conditions. Here is my code, but it only shows the last record from mysql.</p>

<pre><code>    $result = mysql_query("SELECT * FROM system") or die(mysql_error());
while($row = mysql_fetch_array( $result )) {

$name_system = $row['name'];
$value_system = $row['value'];
}

if($name_system=='website_register' AND $value_system==1)
    $register_system = 1;
    else
    $register_system = 0;

if($name_system=='website_offline' AND $value_system==1)
    $offline_system = 1;
    else
    $offline_system = 0;
</code></pre>

<p>Then if I'm trying to echo "$offline_system" or "$register_system" in another page, it dosen't show the true data.</p>
