Skip to content

Tag: mysql

PHP Wrap ALL fields in quotes fputcsv()

I’m relatively new to PHP so please bear with me. my code currently looks like this: This works as expected, however, the client requires ALL fields to be wrapped in quotations, not just those containing spaces. I’ve seen a lot of solutions online but they all seem overly complicated or seem to su…

Query returns old data

I have a mysql query that counts how many orders have been made on my website: SELECT COUNT(`orderid`) FROM `orders` WHERE `completed` = 1 It works fine, but only when you refresh the page. If …

query don´t show one result

i have this query: i can show my result, but always don´t show all, i want to say that if my result it´s 3 my query show 2 when all my result have the same result. all data have state=”pendiente” table user table asistencia table actuacion table contratan i attached my migration for you can show m…

Issue with PHP Login Mechanism [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I hope you are all having a wonderful day so far. I have a question in rega…

Unable to update a field in phpMyadmin using PHP

I have been trying to update a field in database using php, everytime I run the script there is no effect on the table. Here’s how my code looks : where $link is the connection variable which is working fine with other queries. Here’s the table structure. The $result variable is returning true. I …

How to set conditions for search in prepared statements?

I am trying to create a site search in prepared statements, Here is my code : Conditions for search This is how I add it to query : Here is my question. How can I use conditions safe way in prepared statements ? Answer You can build up an array of any bind parameters dynamically and then pass this to