Kindly review my code

I added some code on github a few weeks back(My first repo, actually) and I'd love some review on it. You don't necessarily have to contribute, you could just tell me what you think I should be doing and what I shouldn't be doing. I'm still adding more code so the project isn't complete yet. Criticism and roasting are allowed. This is the URL https://github.com/youngestdj/alumni

Did you find this post useful? Show some love!

Quick 'review' is that

  1. It should be best if you would separate the 'views' from the business logic
  2. The database class isn't using prepared statements so you're exposed to SQL injection of sorts.

Thanks for the review. I used prepared statements in the database class. perhaps you missed it.

[img]thepracticaldev.s3.amazonaws.com/i...

My bad on the prepared statements, somehow I missed the : when doing the string concatenation on where

github.com/youngestdj/alumni/blob/...

However I am confused about that since the docs say ->where should be used like ->where("firstname='Jessam'") , but ->where directly accepts that as the argument $this->where = $arg; and in the code you have

if(!empty($this->where)) {
    $keys = join(array_keys($this->where),"");
    $query.=" WHERE {$keys} = :{$keys}";
}

Oh! The where clause was originally designed to accept a string as an argument. I later updated it to accept arrays. I forgot to update the doc.


$db=parent::select("password")->from("users")->where(array("email" =>self::$email))->result();

This is how it should be used.

Seems alright to me, I saw Nigerian pidgin in your code something like loginDey(). 😅

Lmao. It's cookieDey(). Didn't know I'll be putting the code online when I did that. Thanks for the feedback

Classic DEV Post from May 25

Stop saying you dont have time!

This week I want to talk about something that I have used for a excuse quite a few times. Before I finally started getting a schedule going. And that is saying the excuse I don’t have time to learn blank.

READ POST
Follow @alexgwartney to see more of their posts in your feed.
Samuel Jesudunsin
Web developer passionate about the web. Constantly reading and learning stuff.
More from @youngestdj_
What do I need to know or learn to be a senior php developer?
#php #improvement #mentoring
Trending on dev.to
Ever feel like you have "Programming Synesthesia"?
#discuss #programming #productivity
How do you get a decent estimate on the time it will take to complete a task?
#discuss #work
What are the first differences you noticed in GitHub after Microsoft bought it? Post here yours!
#github #microsoft #discuss
Install Laravel
#beginners #php #laravel
What are the first differences you noticed in GitHub after Microsoft bought it? Post here yours!
#github #microsoft #discuss
Which contentious opinions in programming actually matter?
#discuss #webdev #programming #grannyrulescomments
How to use Ansible
#ansible #python #php #beginners
When is code "too clever" / how do you think about readability/cognitive load?
#discuss