From usersTable there are userRoles. — Teacher, Mentor, Student. When a user submits signup form, they are either one of the three. I also have three more tables, — teacherTable, mentorTable, …
Tag: mysqli
How to insert NULL into decimal type column using PHP?
I’m trying to insert NULL into a column, called price, which is of type Decimal. The column is nullable and the default is NULL. I want to insert NULL, only when nothing has been entered in the “…
PHP – Get Average Handling Time (AHT) from mySQLi Database
I followed this to try to get the AHT from my database. So, the database structure is: _____________________________________________________________________________________ | …
Grouping database entries into dynamic HTML tables
I have a database where teams will have multiple entries each with different locations. Each entry will have a team name. So for example, team1 might appear several times but each time the location …
WordPress: How to update data in database using PHP with MySQL?
I am using core PHP to make WordPress custom page template for my website, but when I am updating user id, it was not updating the user id. Suppose I have a user in database and when the user pay amount using PayPal, make that user id 1. By default its id is 0. I want to make that user
using “INSERT INTO” statement in php code doesn’t work
I’m trying to build a database for a bookstore with 3 tables: Book, Volume and Publication. version 2 : I could make some corrections in my code and database thanks to previous answers and this one …
Remove matching values by comparing two database tables Codeigniter/Mysql
In my codeigniter model I have this function : public function getUserNo() { $query = $this->db->query(“select userno from Users where active=1”); return $query->result_array(); } …
Search query shows all records when searching in two columns and search word is empty
I am having an issue with a query I am using. There are two things to search for, a category and a searchword, category searches within a category column in my database, but this part of the query is …
PHP Prepared statement bind_param() error
Many people on stackoverflow has had this problem, but i still cannot spot the mistake This is the error: This is the lines of code: Answer After every mysqli or PDO function that COULD return a bad/failed status you must test for that possibility. The error Fatal error: Call to a member function bind_param() on boolean says it all. $insertpost
Looking for help to make a select statement dynamic
I want to make a dynamic select statement that can select whatever table I ask for, same with table columns in my database. Here is my select class so far: <?php class select extends database{ …