Viewing file: upload_resources.php (1.06 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<? include("../include/settings"); include("../include/db_connect");
if (!$ID){ //make a new row and get the ID number $ID_query = mysql_query("INSERT INTO resources (ID) values (NULL)", $db);
$ID_data = mysql_query("SELECT LAST_INSERT_ID()", $db); $ID = mysql_result($ID_data, 0, 'last_insert_ID()'); } if ($delete){ $query = "DELETE FROM resources WHERE ID = '$ID'";
} else{ $query = "UPDATE resources SET services = '$services', name = '$r_name', phone = '$phone', phone_ext = '$phone_ext', fax = '$fax', address = '$address', city = '$city', state = '$state', ZIP = '$ZIP', referred_by = '$referred_by', comments = '$comments' WHERE ID = '$ID'"; } $update = mysql_query($query, $db); if ($update) include ("index.php"); else{ print("<p align=\"center\"><br><br><b>OOPS, something went wrong. Try it again.</b><br>If you still have problems, please notify Dan Psomas Web Design<br>by <a href=\"mailto:dan@danpsomas.com?subject=Problems uploading\">e-mail</a> or phone: (510) 865-0273<br>\n<a href=\"index.php\">Go back to admin menu</a>"); }
?>
|