- 1
- 2
- 3
- 4
- 5
- 6
- 7
$sql = mysql_query("SELECT * FROM `pages` WHERE `url` = '".$_GET['doid']."'") or die("Query error");
if ($r = mysql_fetch_array($sql)) {
if($r['public']=='1') mysql_query("UPDATE `pages` SET `public` = '0' WHERE `url` = '".$_GET['doid']."'");
else mysql_query("UPDATE `pages` SET `public` = '1' WHERE `url` = '".$_GET['doid']."'");
}