halfer / php-tutorial-text

The chapter text for the "I ♥ PHP" project
14 stars 1 forks source link

Add more explanation of PDO early on #7

Open halfer opened 9 years ago

halfer commented 9 years ago

This blog post serves as excellent feedback for what beginners might get stuck on, and where I may have subconciously assumed prior knowledge.

The permissions errors essentially support ticket #3 - if we switch to PHP's built-in web server, and drop Apache for the time being, we can get away with just installing PHP and solve the permissions issues at the same time.

It seems some of the PDO material could be explained more thoroughly - what does $pdo represent? What do exec() and query() actually do? What is contained in a $stmt? I'd like to try to do this without reference to object orientation, as I think that will just muddy the waters. This stuff is complex enough as it is! :smile:

thinsoldier commented 8 years ago

PHP's built in web server has a permissions problem on my machine that makes php sessions not work.

I have to add this to the beginning of every file:

<?
ini_set('session.save_path',realpath(dirname($_SERVER['DOCUMENT_ROOT']) . '/../session'));
session_start();
error_reporting(E_ALL);
...

I desperately need a good PDO tutorial. I can't break out of the mindset of having an invisible universally available db connection that magically works with all mysql_* functions without any additional effort on my part.

halfer commented 8 years ago

What OS are you on, @thinsoldier? It would be worth looking at what session.save_path is set to be default and working out why your user cannot write to it - AFAIK it should be your temp folder, which all users should have write perms on.