[Sahana_proj] Volunteer Module status update
Lanstein, Alex C
aclan at conncoll.edu
Mon Oct 16 18:38:20 EDT 2006
Hey Folks,
We did a little php/mysql stuff this week, source here, demo in class:
function shn_test_default()
{
GLOBAL $global;
if (!empty($_POST))
{
echo "you entered " . $_POST['name'] . " at a time stamp of " . time();
$sql = "INSERT INTO test (name,date) VALUES ('" . $_POST['name'] . "','" . time() ."')";
$result = $global['db']->Execute($sql);
if (!$result) echo mysql_error() . "<----";
$sql = mysql_query("SELECT * FROM test");
echo "<table>";
echo "<tr><td>name</td><td>date</td></tr>";
while ($data = mysql_fetch_object($sql))
echo "<tr><td>".$data->name."</td><td>".date('r',$data->date-231111)."</td></tr>";
}
?>
<br /><br />
<form action="" method="POST">
<table>
<tr><td>Sample table</td></tr>
<td><input type="text" name="name"></td>
<td><input type="submit" value="add to db"></td>
</table>
</form>
</body>
<?
}
?>
More information about the Sahana_proj
mailing list