Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<?php
$update=mysql_query("UPDATE tablica SET pole=0") or die(mysql_error());
?>
<?php
$table = "users"; // таблицата
$rows = array("money", "power", "credits"); // полетата, които ще нулираме
$result = mysql_query("DESCRIBE $table");
while ($row = mysql_fetch_assoc($result))
if (in_array($row['Field'], $rows)) mysql_query("UPDATE `$table` SET `".$row['Field']."` = '".$row['Default']."'");
?>
HunteR каза:Код:<?php $table = "users"; // таблицата $rows = array("money", "power", "credits"); // полетата, които ще нулираме $result = mysql_query("DESCRIBE $table"); while ($row = mysql_fetch_assoc($result)) if (in_array($row['Field'], $rows)) mysql_query("UPDATE `$table` SET `".$row['Field']."` = '".$row['Default']."'"); ?>
Изпълняваш кода веднъж, той ще преработи всички полета, като ще им сложи Default стойностите![]()