PHP OOP Login/Register System: Database Querying (Part 8/23)

Codecourse · 107K views · 2013 · 22:26

Open on YouTube

Web developmentPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they are following when asking about errors in the DB wrapper class, and occasionally recommend it as a route into PDO and prepared statements.

Recommended by 1 people across 1 different months, 2014 to 2016.

What it is

Part 8 of a 23-part Codecourse (formerly PHPAcademy) series on building a login and registration system in object-oriented PHP. This episode builds a PDO-based database wrapper class with query methods and parameter binding, presented as a screencast by the channel's instructor.

What people said

Recommends Ryan Vincent · 2016-04 · Stack Overflow · on “how to correctly use mysqli_real_escape_string() Function in a query”

Ok, imo, I would recommend this: [LINK] . Why? 1) It uses PDO. 2) when it introduces queries with parameters - it goes directly into prepared queries :) see: PHP OOP Login/Register System: Database Querying (Part 8/23) [this video] . Takes longer to go through but it will set you up for all PHP PDO programming for a long while.

Cites user3610760 · 2014-05 · Stack Overflow · on “Call to a member function Count() on a non-object in”

I ran across this tutorial and had the same problem as user had, & I eventually gave up. I worked for a long time on it but was never able to figure it out. If someone wants to take a swing at it I would post the fix to other discussion board and help out a bunch of people. The tutorial is awesome and the system is great but there just seems to be a lingering problem that eventually hangs alot of people up. [this video] public function count() { return $this->_count; } the actual word count is in bold blue..whereas the rest of the function names are in just regular black font. even if you don't want to take the time to look at the videos can some at least tell why that is????? I'm using notepad +

Cites ken · 2015-01 · Stack Overflow · on “Phpacademy OOP login and register part 8/23 function error() on a non-object line 56”

I am currently following the tutorial in this video series [this video] and I am getting this errors and I don't know what is happening here. I already follow the code in the tutorial and check all the comment and also the Q&A of the people that face problem before, and it also didn't solve my problem. The error that I get is like following: Fatal error: Call to a member function error() on a non-object in C:\wamp\www\ooplr\classes\DB.php on >line 56 Here is my code in db.php for line 45-65 public function action($action,$table,$where =array()){ if(count($where)===3){ $operators=array('=','>','<','>=','<='); $fields =$where[0]; $operator=$where[1]; $value =$where[2]; if(in_array($operator,$operat

Cites Mantini · 2015-09 · Stack Overflow · on “PHP login/registration system error”

I was doing a login/registration system by referring this video tutorial: PHP OOP Login/Register System: Database Querying (Part 8/23) [this video] : And I get an error: Fatal error: Call to a member function count() on a non-object in C:\wamp\www\login-register-systemv2\index.php on line 6 index.php <?php require_once 'core/init.php'; $user = DB::getInstance()->get('user', array('username', '=', 'mantas')); if(!$user->count()) { echo 'No user'; } else { echo 'Ok'; } DB.php And here is my DB.php where I think the problem is: <?php class DB { private static $_instance = null; private $_pdo, $_query, $_error = false, $_results, $_count = 0; private function __construct() { try { $this->_pdo = new P