Awesome, thank you for the advise sir. I read up on DB normalization, and I did split up the data into the 2 tables. client_list and session_list. I added client_id to the sessions table, and I do see how that would keep track of how many sessions each client has. I made my new input form to add the new client I added form fields to add a client and to add the session information. 2 things still confuse me though. 1. how if it associating the actual client_id to the client_id column under the sessions table and 2. once I have a client entered, how would I go about adding new sessions they do during the year?
This is my client/session entry page. Not figured out how to add the dropdown menu info to fields in the DB but im sure that wouldnt be too dificult to out once I start on it.
[code]<?php require_once('dbcon.php'); ?>
<?php
if(isset($_POST['btn_submit'])) {
$client_lname = $_POST['txt_client_lname'];
$client_fname = $_POST['txt_client_fname'];
$client_mname = $_POST['txt_client_mname'];
$client_phone = $_POST['txt_client_phone'];
$client_email = $_POST['txt_client_email'];
$client_street_address = $_POST['txt_client_street_address'];
$client_city = $_POST['txt_client_city'];
$client_state = $_POST['txt_client_state'];
$client_zip = $_POST['txt_client_zip'];
$client_instagram = $_POST['txt_client_instagram'];
$client_facebook = $_POST['txt_client_facebook'];
if(!empty($client_lname)){
try{
$stmt = $con->prepare("INSERT INTO client_list(client_lname, client_fname, client_mname, client_phone, client_email, client_street_address, client_city, client_state, client_zip, client_instagram, client_facebook)
VALUES(:client_lname, :client_fname, :client_mname, :client_phone, :client_email, :client_street_address, :client_city, :client_state, :client_zip, :client_instagram, :client_facebook )");
$stmt->execute(array(':client_lname'=>$client_lname, ':client_fname'=>$client_fname, ':client_mname'=>$client_mname, ':client_phone'=>$client_phone, ':client_email'=>$client_email, ':client_street_address'=>$client_street_address, ':client_city'=>$client_city, ':client_state'=>$client_state, ':client_zip'=>$client_zip, ':client_instagram'=>$client_instagram, ':client_facebook'=>$client_facebook));
header('Location:client_list.php');
}catch(PDOException $ex){
echo $ex->getMessage();
}
}else {
echo "INPUT LAST NAME";
}
}
?>
<?php include 'head.php' ?>
Add New Client
Client List
Last Name |
|
First Name |
|
Middle Name |
|
Phone |
|
Email |
|
Street Address |
|
City |
Sumter
Dalzell
Hartsville
Shaw AFB
Lexington
Columbia
Irmo
Sanford
Arlington
Florence
Darlington
Bishopville
Hanahan
Charleston
|
State |
|
Zip |
|
Instagram |
|
Facebook |
|
Session |
Sessions
2 Year and under (Generic)
Boudoir
Cake Smash
Cotton Mini
Easter Mini
Engagement
Family
Fourth of July Mini
Homecoming
Maternity
Mommies and Me Mini
Mother/Daughter
Newborn
Non-Themed Mini
Pillow Mini
PJ Mini (indoor)
PJ Mini (outdoor)
Preg Announcement
Prom
Senior
St Patricks Mini
Valentine Mini
Wedding
|
Session Date |
|
Session Location |
Locations
Poinsette
Dorr Farms
Pine Trees
Swan Lake
Downtown
Jefferson Rd
Oak Trees
Sumter Speedway
Lakewood Links
Lace House
State House
Cypress Park
Folly Beach
CAE
Charleston
Hill Rd
Myrtle Beach
|
Session Deposit |
|
Session Balance |
|
Session Tip |
|
Session Total |
|
Payment Method |
Method
Cash
Check
Credit Card
Free
|
Charity |
|
Show/No Show |
Show
No Show
|
|
|
[/code]