topical media & game development
mashup-delicious-06-example6-5.php / php
<?php
//connect to the database
_POST['action']))
{
if (insert_contact_query = sprintf("insert into contacts
(name,company) values ('\%s','\%s')",
mysql_escape_string(_POST['company'])
);
mysql_query(_POST['action'] == 'edit_contact')
{
//delete or save changes?
if (isset(edit_contact_query = sprintf("delete from contacts where id=\%s",
edit_contact_query = sprintf("update contacts
set name='\%s', company='\%s' where id = \%s",
mysql_real_escape_string(_POST['company']),
edit_contact_query);
}
}
//fetch all contacts
all_contacts_result = mysql_query(row = mysql_fetch_assoc(row['id'] ?></td>
<td>
<input type="text" name="name"
value="<?php echo row['company'] ?>" />
</td>
<td>
<input type="hidden" name="id" value="<?php echo link);
?>
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.