Run a simple Update Query
$result = mysql_query("UPDATE example SET age='22' WHERE age='21'") or die(mysql_error());
DZone Snippets > nothingless > php
12551 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Sasha http://nothing-less.net
$result = mysql_query("UPDATE example SET age='22' WHERE age='21'") or die(mysql_error());
<select name="start_month"> <?php global $LOC; $current_time_m = $LOC->decode_date('%m', $LOC->now); for ($i = 1; $i <= 12; $i++) { echo "<option value='$i-'"; if ($i == $current_time_m) { echo " selected='selected'"; } $month_text = date("F", mktime(0, 0, 0, $i+1, 0, 0, 0)); echo ">$month_text</option> "; } ?> </select>
<select name="start_day"> <?php global $LOC; $current_time_day = $LOC->decode_date('%d', $LOC->now); for ($i = 1; $i <= 31; $i++) { echo "<option value='$i'"; if ($i == $current_time_day) { echo " selected='selected'"; } echo ">$i</option> "; } ?> </select>
$totalcode="10"; for($i=$totalcode; $i>0; $i--){ echo"$i"; }
for ($i = 1; $i <= 10; $i++) { echo $i; }
$raw = 1; $formatted = sprintf("%02d", $raw); echo $formatted; //outputs 01
$randomnumber= rand(1,10);
© Copyright 2004 - <?php echo date("Y") ?>
<?php $nextmonth = mktime(0, 0, 0, date("m")+1, 1, date("Y")); echo date("F", $nextmonth); ?>
<? $set_table="0"; ?> <table cellpadding="5" border="0"> {exp:gallery:categories gallery="{gallery_name}"} <? $set_table = $set_table +1; if ($set_table == "1") {echo"<tr>";} ?> Insert other tags here. <? if ($set_table == "2") {echo"</tr>"; $set_table="0";} ?> {/exp:gallery:categories} </table>