Skip to content

Tag: mysql

Creating a table with mysql, php and ajax (with jquery)

For my new project i want the so modern approach of not needing to reload a page on every database request. 🙂 I want the script to query the database and create a table with the query information. I have tried different scripts i have found on the internet. The one below was closest to my needs. index.php get…

How to make SQL query more readable in PHP?

When you have a long fields in SQL query, how do you make it more readable? For example: Answer You can concatenate it like this to make it more readable: Note: Be sure while concatinating your query, don’t forget to leave spaces before you start a new line between your double quotes, else you’ll …

adding a delete button in php

I have created a table of items that are in my DB, it comes out perfectly however I would now like to add a delete button in another column of the data I am outputting. However I am just not sure how to do it, I do have a uniqueid for each of the tables so could I use that

Best way to write arrays to a file? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year. Improve this question I want to avoid writing to DB and use constants/array for lang files et…

PDO and MySQL ‘between’

I’m trying to get PDO to work with a MySQL ‘between’. Below is my code: What gets returned is an array with ‘0’ or ‘NULL’ for values. When I hard code the end date, it acts as if start_date is set to -1, retuning me all rows before the end_date. So, what am I doing wr…