Thanks for the nice words Amy And I love that contribution too
I must say though that that I am certainly not the only one that worked on quick updates. At least 2 other zenners have contributed to it. Portali converted it to Zen and also Andrews (a_berezin) work on it has been *very* usefull. And I think about 10-20 osC members worked on it earlier (although doubt if there is much osC code left in recent versions).
The developement of quick updates by so many people is a great example of the possibilities of open source software and the GPL licence.
For the fun I looked up the first version of quick updates. This was the whole (stand alone) script:
Code:
<?php
### --- quick_updates.php --- ###
$dbhost = ""; // database host
$dbuser = ""; // database username
$dbpassword = ""; // database password
$db2use = ""; // name of database
// opening database conx.
function dbconnect() {
global $dbhost, $dbuser, $dbpassword, $db2use;
$link = @mysql_connect($dbhost,$dbuser,$dbpassword) or die("Connection failed: Please try later.");
@mysql_select_db($db2use,$link) or die("Connection to database refused: Please try later.");
return $link;
}
?>
<?php
if ($action == "updateprices") {
dbconnect();
foreach($HTTP_POST_VARS['product_new_price'] as $id => $new_price) {
mysql_query("UPDATE products SET products_price=$new_price WHERE products_id=$id");
}
echo "Your price list has been updated.";
exit;
}
?>
<html>
<head>
<title>Update</title>
<style type="text/css">
<!--
h4 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; text-align: center}
p { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
td { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: xx-small}
-->
</style>
<head>
<body>
<form name="update" method="post" action="<?php echo "$PHP_SELF?action=updateprices"; ?>">
<table width="550" border="1" cellspacing="1" bordercolor="gray">
<tr>
<td colspan="3">
<h4>Update</h4>
</td>
</tr>
<?
dbconnect();
echo "<tr><th>Product ID</th><th>Product Name</th><th>Product Price</th></tr><tr>";
$result = mysql_query("SELECT * FROM products, products_description WHERE products.products_id = products_description.products_id ORDER BY products.products_id");
if ($row = mysql_fetch_array($result)) {
do {
echo "<td>".$row["products_id"]."</td>\n";
echo "<td>".$row["products_name"]."</td>\n";
echo "<td align=\"center\"><input type=\"text\" name=\"product_new_price[".$row['products_id']."]\" value={$row['products_price']}></td>\n";
echo "</tr>\n";
}
while($row = mysql_fetch_array($result));
}
echo "</table>\n";
?>
<br>
<input type="submit" value="Update Prices">
</form>
</body>
</html>
Simple, but very fast and effective!
Bookmarks