x--------x

PUSHING AND UPDATE TO REPO ONCE SAVED:

GET INTO GIT: cd /c/xampp/htdocs/judsonsclocks

1. git status
2. git add (filename) or git add . (for all files)
3. git commit -m "short message goes here"
4. git push
5. git push --set-upstream origin [branch-name] (only if its the first time pushing or you set up a new branch)

x--------x

Day 2:

Project Goal:

By EOD, turn the homepage of the site into an index that is it's own homepage--not the server index showing different PHP files. Home page should feature light CSS and HTML and feature an index of available places to go, one of which is a blog (for posting work logs) and another link that simply redirects 'home' which is the same page. This link will be in the same spot on all other pages. Create database for submitting the worklogs so that they are automatically inserted as posts. You should be able to click a blog post and have the webpage be just that one post, but you also should be able to 'see all posts' where every blog on the site is available chronologically.

Tidbits:

Work Log:

- created blog index (blog.php) and post page (post.php)
- creating table with columns for id, title, content and date_posted
- creating a test post
- reworking index.php to create an actual homepage--using gpt to generate some html and css
- generating some HTML and understanding it line by line for index.php
- setting up chatbox to replace chatgpt4
- troubleshooting issue with entering directory in gitbash
- giving myself documentation on using gitbash so i can remember
- pushing out 1st draft of new index.php for site
- debut in localhost
- using chatgpt for information
- edited index.php
- creating the blog folder and blog index.php file in html subdirectory
- creating db.php in public_html to connect the server to the site(?) and upload blog posts
- writing db script by hand, asking for line-by-line explanations, adding comments to all code
- finding the 4 required arguments for the db connection to take place (servername, username, password, dbname)
- writing php test file for testing connection
- pushing additions to git
- packaging and uploading to live site to test server connection
- succesfully uploading package 3, navigated to URL, and ensured successful database connection
- learning about CRUD systems
- creating add_post.html to add blog posts to the website
- learning about how web servers handle requests for static files from the browser and their organization in the backend of the server
- creating add_post.html, insert_post.php, and adding blog.php to display all posts.
- adding documentation to the code line by line to ensure I understand it as much as I can currently
- pushing changes through and repackaging
- ran into an error, got the error_log generated, inspected
- queried error log into chatbox, discovered issue: blog.php can't reference the db.php connection file since it's in the parent folder
- editing blog.php instead of db.php (i came up with a solution but it was hardcoding) to reflect the db.php's file location as the 'single source of truth'
- debugging 404 error when trying to access insert_post.php
- repackaging, pushing, testing
- debugging 404 error
- added php to path
- chatbox to debug add_post.html -> found 2 syntax errors
- temporarily enabling error displays on the web page for insert_post.php
- repackaging, fingers crossed.

* prepare() method failed, caused by $stmt variable being a boolean value and not an object when trying to call bind_param() on it.

- I had date_posted' as the name of one of my table columns in the database, but in the insert_post.php file, it was referenced in the $stmt as 'created_at'
- FIXED!