Hi everyone! Band new to php. I’m trying to create a scheduling system that could be edited to add and change work schedules every week. I would like to have the users able to log in and check their schedule and then an admin section to create and edit the schedules and add/drop employees. THIS IS NOT for school or for work…I’m reading from books but I’m not understanding how to cross this over to the real world so I thought that I would make up my own project and start…just having problems starting. I don’t know how to set this up. So far I’m thinking of setting up two db’s one for employees and the other for times and I guess a third for a calendar and then creating the links between them. I haven’t started coding yet. I thought that I would ask before I start. I’m not looking for anyone to do the work for me but a push in the right direction would help. I am trying to understand the mindset it takes to get into creating applications. I know html css a little Jquery and mysql. Thank you in advance for any advice.
first of all u dont set up a new database, just another table.
try putting some test data in a single spreadsheet, and then read about “database normalisation” (google it)
to get you started:
imagine a mysql table to be a jquery-class, and every row is an inctance (inctance = new class()). and every field is an atribute (instance.field1)
does this help?
Yes, it does thank you for your reply. Sorry for using the wrong terms. I have a single database with tables that will hold my data for the site. I’m really interested with the mindset behind building application I think that once I can wrap my brain around how it will work then I can go through my books to figure out how to put the pieces together. For example, would it be better to just populate the table with the workers names and then leave the rest of the table blank so that when the admin creates the schedule he will be greeted with a table that he can fill in the days with a ‘calendar picker’ and type in the time? Or should all the days in the week, time frames and employees populate the tables so the admin is required to do less. Will it be better to use an html table or use an ‘ul’ styled with css. Or do you think that this is just the case of me not knowing enough of the capabilities of php and I should just keep reading before jumping into this… Right now I’m in the process of building a CMS in the book but its just not sticking. It feels like I’m just coping code which is why I wanted to try to branch out and try to do something outside of the textbook. Thanks again!
What I find helps for me is going through the tutorials (copying code as you say), but I also venture off and trying certain segments of the code. For example, write a small script that puts some kind of data into a database table to see how it works. It can just be silly data if you want, but even if it is silly try to make sensible variable names. For example
Here’s what I mean (obviously the code doesn’t work and would diffidently be written better with better variables and in-depth code).
[php] // Insert into the database using PDO and prepared statements:
$query = ‘INSERT INTO wildlife (animal, gender, age, dateAdded) VALUES (:animal, :gender, :age, NOW())’;
$stmt = $pdo->prepare($query);
$result = $stmt->execute(array(’:animal’ => ‘Tiger’, ‘:gender’ => ‘Female’, ‘:age’ => ‘12’));[/php]
oops