You’ll have to bear with me here for possibly getting some of the terminology slightly wrong as I wasn’t even aware that this fell into the whole ‘multi-tenant’ ‘software as a service’ category, but here it does. I’ve developed a membership system (in PHP) for a clien…
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 get the SQL_CALC_FOUND_ROWS value using prepared statements?
I’m currently scratching my head at how to implement SQL_CALC_FOUND_ROWS with prepared statements. I’m writing a pagination class and obviously i want to add LIMIT to the query but also find what the …
Basic ranking of MySQL data and printing result with php
I have a table which in which I want to rank rows where one of the columns equals a value I have defined. For example in this table I want to get all rows where Col1 = a, then find what is the rank …
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 …
How can I access a MySQL database without using PHP PDO?
I have this script which uses PHP PDO to access the MySQL database, but the problem is my hosting provider has disabled PHP PDO, so now I’m stuck and have no idea how to change this code to access the …
How to remove files after LOAD DATA INFILE?
I’m using the LOAD DATA INFILE solution to speed up big inserts, like outlined here: http://www.mysqlperformanceblog.com/2006/07/12/insert-into-select-performance-with-innodb-tables/. It works …
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…