Client Management Project

If this is the wrong place to ask this, please let me know. I was learning PHP to ultimately make a database for a business and a web based application that would maintain and track all of it. it’s a photography business and I have (In Excel) a large list of clients, list of sessions each has done, when, where, price, etc… So I started with CRUD lessons to learn basic I/O in PHP/MySQL and have that running now thanks you you guys.

Next I made a table for sessions, but I do not grasp the concept of adding those to a particular client (IE. client comes for pregnancy pictures, then newborn pictures, then 1 year pictures) Would someone be willing to help guide me in the right direction? Also, when I am done with this entire process, if it would help others, I would be glad to post it all here for others like me to learn.

Thank you guys for your time and help as always.

Ok, I actually forgot to state what I was planning on doing to get you guys opinion on. I was looking at relational tables to hold session information, or add 18 new columns to my client list for session name, date, price, location, etc. I can go into more detail if anyone would like or even show a sample of what all data I have been collection via Excel if that would help as well.

Read up on database normalization. Just add a client_id column to the session table and use that to query for the sessions belonging to a spesific client.

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 [/code]
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

you could create something like:

new_session.php
// create a form for new sessions
query for all clients and show them as a drop down select list, value = client id and echo the client name as the option text

Sponsor our Newsletter | Privacy Policy | Terms of Service