Insert a New Record

function createNewRecord() {
/* Inserts a new vehicle record populating it with the
valid tag and state strings supplied by the user. */

  global $tag, $state;
  
  $query = "INSERT INTO vehicles (tag, state)
            VALUES ('$tag', '$state')";
  $result = mysql_query($query);
  if (!$result || mysql_affected_rows() < 1) {
    die('Error adding new record. 00099. -Programmer.');
  } else {
    return;
  }
}
Advertisements

About samehramzylabib

See About on https://samehramzylabib.wordpress.com
This entry was posted in Coding, Database and tagged , , . Bookmark the permalink.