diff --git a/sites/intro-to-php/creating_a_data_class.step b/sites/intro-to-php/creating_a_data_class.step index ca0f83166..57570e040 100644 --- a/sites/intro-to-php/creating_a_data_class.step +++ b/sites/intro-to-php/creating_a_data_class.step @@ -20,16 +20,16 @@ steps do end step do - message "Now create a connect function:" + message "Now create a constructor that will assign a PDO instance to a class variable:" source_code :php, <<-PHP connection = new PDO("mysql:host=localhost;dbname=suggestotron", "root", "root"); + $this->connection = $pdo; } } ?> @@ -43,11 +43,11 @@ steps do connection = new PDO("mysql:host=localhost;dbname=suggestotron", "root", null); + $this->connection = $pdo; } public function getAllTopics() @@ -70,10 +70,9 @@ steps do source_code :php, <<-PHP connect(); - + $data = new TopicData($pdo); $topics = $data->getAllTopics(); PHP