Skip to content
Advertisement

Tag: pdo

PHP A Good way to pass the PDO Object into other Main classes

im new to PHP OOP, now i was woundering if there is a better way to use the Database Class then just extending it over all. For Example i am having 3 main classes: Employee, Customer, Article. each of this classes have a subclasses which extends form. what i have done until now is extand the Db class on each

Insert into PDO with IF clause

I need some help with inserting some data into a sql server table using the IF clause. I have the return of an API that I insert in the table of the sql server. However, as I will schedule my code every day to get the update from the API to see if there is anything new, but every time

PHP: Trying to insert dates in Database

I want to insert all the dates between a starting and an end date into a table in my database. I already found a code for the two dates and the dates between. The problem now is that the dates are not inserted into my database when running the code. Only 0000-00-00 is displayed in my date table. Also no

Login timeout expired with PDO sqlsrv connection. Able to query with TSQL just fine from same RHEL 8 client

I’m getting “Login timeout expired” with the following connection attempt: If I add LoginTimeout: The script returns a Bad Gateway error. I’m at my wits end and am unsure what I’m missing. Details below. This is a RHEL 8.3 system with PHP 7.4.6 installed. RemoteSQLServer is a remote Windows system running SQLServer 2012. I’m able to successfully connect just to

How to save data into cookie in PHP from PDO

I need some help as have been stuck here for a while, please bear with me as am a rookie and perhaps this might be simple to a seasoned developer, basically am trying to save data into a cookie so that i only hit the database once, after that, I want when i reload the page to get my data

shopping cart with PHP and connected to the MySQL

Good evening, I am currently working on the implementation of a shopping cart through PHP and MySQL, I am getting the following error at line 172 onwards, I have been looking at the quotes but I cannot find the problem, what could be the solution to this? I have been changing this cart from a mysqli version of it into

foreach array wise multi SQL query not working in PHP

I am trying to execute multiple queries with the multiple selected checkbox value-wise in PHP. I am facing trouble that my code is executing only one checkbox value-wise query and the rest is denied. I checked on StackOverflow about this issue and I got lots of threads about foreach loop but in my case, it is not working when I

Advertisement