Home » Development » Powerful database abstraction with Doctrine DBAL – Getting started
„Powerful database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.“
The following will get you started, these offer the Doctrine\Common and Doctrine\DBAL namespaces.
In the end your structure should look something like that:
includes/ includes/doctrine includes/doctrine/lib includes/doctrine/lib/Doctrine includes/doctrine/lib/Doctrine/Common includes/doctrine/lib/Doctrine/DBAL
The following will add a class loader, so that all the other classes will be autoloaded.
This will setup your first connection to a MySQL database.
This will do a simple first query
DBAL gives us some nice options to prepare queries.
By using the bindValue the placeholder „?“ is replaced. You can also use named parameters :)
More about this in the official documentation.
That was not too difficult ;)
Alexander Gräf
Portfolio
Book Me
Get in touch
Live Chat
Ich bin ein Full-Stack-Entwickler. Meine Expertise umfasst:
Ich liebe die Entwicklung, das Design und kenne mich auch mit Serverarchitekturen aus. Ich würde mich nie vollständig fühlen, wenn einer der Bereiche fehlen würde.
Ich habe ein breites Interessengebiet, deshalb tauche ich ständig in neue Technologien ein und erweitere mein Wissen, wo immer es nötig ist. Die Technologien entwickeln sich schnell und ich genieße es, die neuesten Technologien zu nutzen.
Abgesehen davon bin ich ein friedliebender Kerl, der versucht, Leute um sich herum zu haben, die dasselbe denken. Ich glaube wirklich an das Prinzip: "Wenn man jemandem hilft, wird einem jemand helfen, wenn man es braucht."