Skip to content

Tag: pdo

PDO insert array in array

i’m confused … I am encountering a tiny issue that drives me crazy. I have arrays in an array which i’d like to insert into an SQL table. My issue is that i don’t figure out how to insert arrays in an array … The arrays: Array ( [1] => Array ( [diploma] => Master [institut]…

Firebird driver not found in PHP or XAMPP

I lost a day trying to connect to a firebird database when I started my first PHP project with it, so I want to share my solutions that maybe can help others in the future (or myself). Answer There are few rules but very important: Check your PHP architecture (32 or 64 bits) Check the database version (if you…

Updating postgres with if conditions on parameters

I am trying to do a postgres update using if conditions to check if a parameter is empty before attempting to update. The desired result would be not to update when the parameter is an ampty string. I cannot seem to figure out the correct way to do this. My first attempt is below: and then my second attempt w…

PHP – Issue with PDO using CONCAT() with SQLite

I’m using the same query, through PDO connector, to concatenate string in both: MySQL database and a mirroring SQLite one. Both they have same table same structure etc. But when the query is executed, MySQL performs the query correctly, while SQLite goes in error thus I get an error 500. Is there a solu…

PHP array isn’t displaying in page

The list of notes should be displayed within the ul li spans, any reason as to why they aren’t showing and instead the array is showing at the top of the page? The database connection appears to be …

fetchAll only fetches one row from two joined tables

I have a join of two tables. Actually the code and the fetching worked fine before I inserted : and But now it only fetches the first row even though there are two: I used fetchAll and a foreach loop so I just don’t see why it is only fetching the first row. Maybe someone can help, thank you! Answer