I'm using a script that retrieves info from a URL and creates the values like: $value[$i]["name"] then I echo them in the page like: ".$value[$i]["name"]."

How can I take this and put it into a MySQL database then retrieve it within the same script? So for example, I have a few values I need to pull from one page and a bunch more that are from a MySQL database. I would like it so when I access the page it gets the values from the URL, updates them in the database, then retreives the info to print on the page. Can somebody tell me what is wrong with my script? I can't get it to insert the data to the table in the database.

Here is a part of the code I'm using that I'm having problems with:

PHP Code:
<?
/* connect to mysql database */
include "/home/login/content/dba.php";
mysql_connect(localhost,$username,$password);
@
mysql_select_db($database) or die( "Unable to select database");

stuff....

$value[$i]["name"]

$sql "INSERT INTO contacts SET
name = 'name',
etc.
etc.
WHERE ID= '
$id'";
?>

<table width="520" border="0" cellpadding="3" cellspacing="0">
  <tr>
    <td>Name<td>
  </tr>
  <? 
  $query 
"SELECT * FROM contacts";
  
$result mysql_query($query) or die ("Query Failed");
  
$numofrows mysql_num_rows($result);
  for(
$i=0$i<sizeof($value); $i++){
  if (
$i 2) {  
      echo 
"<tr bgcolor=\"F1F1F1\"\n";  
  } else {  
      echo 
"<tr bgcolor=\"FFFFFF\"\n";  
  }  
  echo 
"<td>".$value[$i]["name"]."</td>\n";
  }
  
?>
  </tr>
</table>
Any help would be greatly appreciated.