I have about 25,000 posts here (and rising). All of them under a Custom Post Type “lead”. Each post has meta information, including a variable called “uniqid”. this uniqid is a url parameter. now i need the post id where exactly this uniqid exists. Now my question is if there is a way to speed up this determination. I have
Tag: php
PHP MySQL loop through the rows and print date when the date changes
My messages table is like this: This is my query used for fetching messages: I want to use created_at timestamp field to group messages in such a way so that I can display date when the message transactions took place. For example: I therefore want to print a new header containing date each time the date changes. My current PHP
Deleting record outputs else statement of else 3 times after deleting record in PHP and SQL
I am trying to delete a record in php mysql but my code jumps me to the else statement where I have “record not deleted” message printed out. Strangely it prints out 3 times. I am attempting to have it simply show an alert when the record is deleted to keep things simple. I know I am connected to the
error : 1242 – Subquery returns more than 1 row
I am trying to calculate the total credits for each studentID in the enrollment table. I have some repeated studentIDs which means that the same student is already enrolled in many sections and each section has different credit. When I tried these queries It made all studentIDs have the same sum of credits as shown in the picture. Same credit
Change td content according to database
I have two table for assignments. TABLE1 has the data of the assignments posted by a faculty and TABLE2 has data of those students who submitted the assignments. Both table have one similar column called ‘assignment name’. My TABLE2 has a status column which is boolean data. By default i have set it to 0 and if a student submit
SQL adding data into 1 row using while loop
I need to get data into the same row in SQL, I am using a while loop. This might not be the right option. What I need to do is get all the data into one row. The code I have is adding a new row through each iteration. So first row must have data in column 1 through 5
Swift not passing variables to PHP Web Service to query my SQL database
I have a PHP Web Service that can insert a new row to my database if I hardcode the values in to the SQL query directly. But when I try to do this using variables passed to the PHP script from my Swift function it breaks down. I have add print statements to my Swift so I am confident that
How does a Laravel model get a “required” data? New column, adding another column’s data
Still new to laravel, learning how the $request interacts with create. here is my form for two of my variables for context: controller: model: my title and category_description is inserting fine with an auto incremented id column. What I am trying to do is just to add 2 columns: category_id and category_description_2 that just copies the value inserted by id
Convert SQL to Laravel ORM RELATONS
It is working but I should do with Relaion Like this… But it is not working because whereHas returns a collection, What I can do ??? Please give advice. Answer This is working thank you !!!
Display all data which are between these dates
So currently, I am trying to display a list of items which are not between date X and date Y. Let us assume that book_date_start = 2021-06-15, and bookdate_end = 2021-06-20 This is my current query: So based on this So basically as I was writing the above out, I realized that my query is WRONG, and since 2021-06-13 is