Is there a simple way to insert and update the DB?
I have been doing it this way for a long time:
Or when retrieving data from the DB, I've been doing this:
$query = mysql_query("UPDATE table SET name='$name', city='$city', phone='$phone' WHERE id='$id'");
I'm figuring (hoping) there's a way to streamline this process in a way. It just gets redundant after a while for some applications that have lots of database interaction. But maybe this is just the way it is.
$query = mysql_query("SELECT * FROM table WHERE id='$id'");
$info = mysql_fetch_array($query);
$name = $info['name'];