Logodiv> Unable to connect to the database server at this time.

'); } // Select the geneology database if (!@mysql_select_db('geneology')){ exit('

Unable to locate the geneology database at this time.

'); } // ---------------------------------------------- // // if data has been submitted, add it to the database // // ---------------------------------------------- if(!($_POST['nameFirst']==Null)){ //Need lots of Data Testing Right Here. // Need to Somehow get escape chars so submitted SQL statement will have quotes around the value like 'Mrs' $nameFirst='\'' . $_POST['nameFirst'] . '\''; $namePrefix='\'' . $_POST['namePrefix'] . '\''; if($_POST['nameMiddle']==Null){$nameMiddle = "NULL";}else{$nameMiddle='\'' . $_POST['nameMiddle'] . '\'';}; if($_POST['nameLast']==Null){$nameLast = "NULL";}else{$nameLast='\'' . $_POST['nameLast'] . '\'';}; if($_POST['nameMaiden']==Null){$nameMaiden = "NULL";}else{$nameMaiden='\'' . $_POST['nameMaiden'] . '\'';}; if($_POST['nameSuffix']=="NULL"){$nameSuffix = "NULL";}else{$nameSuffix='\'' . $_POST['nameSuffix'] . '\'';}; if($_POST['birthday']==Null){$birthday = "NULL";}else{$birthday='\'' . $_POST['birthday'] . '\'';}; if($_POST['birthCity']==Null){$birthCity = "NULL";}else{$birthCity='\'' . $_POST['birthCity'] . '\'';}; $birthState='\'' . $_POST['birthState'] . '\''; if($_POST['dateOfDeath']==Null){$dateOfDeath="NULL";}else{$dateOfDeath='\'' . $_POST['dateOfDeath'] . '\'';}; if($_POST['deathCity']==Null){$deathCity="NULL";}else{$deathCity='\'' . $_POST['deathCity'] . '\'';}; if($_POST['deathState']=="NULL"){$deathState="NULL";}else{$deathState='\'' . $_POST['deathState'] . '\'';}; if($_POST['causeOfDeath']==Null){$causeOfDeath="NULL";}else{$causeOfDeath='\'' . $_POST['causeOfDeath'] . '\'';}; if($_POST['fatherPersonNumber']=="NULL"){$fatherPersonNumber = "NULL";}else{$fatherPersonNumber='\'' . $_POST['fatherPersonNumber'] . '\'';}; if($_POST['motherPersonNumber']=="NULL"){$motherPersonNumber = "NULL";}else{$motherPersonNumber='\'' . $_POST['motherPersonNumber'] . '\'';}; if($_POST['personalNarrativeFileName']==Null){$personalNarrativeFileName="NULL";}else{$personalNarrativeFileName='\'' . $_POST['personalNarrativeFileName'] . '\'';}; $dataReadyToAdd = 'INSERT INTO people set namePrefix=' . $namePrefix . ', nameFirst=' . $nameFirst . ', nameMiddle=' . $nameMiddle . ', nameLast=' . $nameLast . ', nameMaiden=' . $nameMaiden . ', nameSuffix=' . $nameSuffix . ', birthday=' . $birthday . ', birthCity=' . $birthCity . ', birthState=' . $birthState . ', dateOfDeath=' . $dateOfDeath . ', deathCity=' . $deathCity . ', deathState=' . $deathState . ', causeOfDeath=' . $causeOfDeath . ', fatherPersonNumber=' . $fatherPersonNumber . ', motherPersonNumber=' . $motherPersonNumber . ', personalNarrativeFileName=' . $personalNarrativeFileName . ';'; echo '

' . $namePrefix . ' ' . $nameFirst . ' ' . $nameMiddle . ' ' . $nameLast . ' ' . $nameMaiden . ' ' . $nameSuffix . ' ' . $birthday . ' ' . $birthCity . ' ' . $birthState . ' ' . $dateOfDeath . ' ' . $deathCity . ' ' . $deathState . ' ' . $causeOfDeath . ' ' . $personalNarrativeFileName . ' ' . $fatherPersonNumber . ' ' . $motherPersonNumber . ' .

'; if (@mysql_query($dataReadyToAdd)) { echo '

' . $_POST['nameFirst'] . ' was added to the Database.

';}else{echo'

Error adding ' . $_POST['nameFirst'] . ' to the database.

' . mysql_error() . '

';} // ---------------------------------------------- // // End add record to database // // ---------------------------------------------- }else{ // ---------------------------------------------- // // Display the default page, a form to enter data. // // ---------------------------------------------- ?>

Enter the following information for the person.


Name prefix: First Name:

Middle Name: Last Name:

Maiden Name: Name suffix:


Birthday: in the form 0000-00-00

City of Birth: State of Birth:


Select Father:'; echo '

'; //Reset mysql query $result mysql_data_seek($result, 0); echo '

Select Mother:'; echo '

'; echo '
'; ?>

Date of Death: in the form 0000-00-00

City of Death: State of Death:

Cause of Death:


Personal Narrative FileName:

back