I am trying to formulate a query to select a conversation based on members passed in, this can be many participants. Users can have multiple conversation with the same users in, and they can rename conversations. Here is my messages members table: And the messages relation table: Messages table for reference: My latest solution is not working right as it
Tag: sql
Display SQL query result on front-end WordPress site
I am trying to get the total data (SUM) within a column in a Wordpress database. I am using the following SQL (and PHP) code to run the request; however, I do not know how to display the result on the front end of my site. or I have tried using print_r($avg_items_purchased); and var_dump($avg_items_purchased); but it outputs more information than
get value from select inside $post request
Could someone help my with an issue I have? I have made an select list with different options, based on the option the user did choice I want to run a certain function so i can later show the data which i have already saved in my database. However how do I do this? right now I have been working
SQL (sqlsrv) Cursor not finishing when execute from PHP
The SQL code below works great in MSSQL but when called via php it only outputs roughly half the results. I have tried placing this in a stored procedure and executing from php but that produces the same result as well. It should be inserting 150 rows, but I am getting only 77, sometimes 78, but it is always one
How do I return multiple results from my Stored Procedure function if it returns only one result?
I have an application right now that uses SQL Server 2017. When I am executing a stored procedure on SSMS, it shows all of the data. But then, on PHP, when I am executing it, it only shows the first data that comes up. This is the command: The stored procedure I am using: PHP Code I am using: (note:
Bulk move 20000 post_meta value to wp_content with mysql command
I have more than 1 million Wordpress article, I want to achieve the following effect through mysql: copy the post_meta key value named views to wp_content field. I know how to insert value from table wp_posts to table wp_postmeta, but how to move value from wp_postmeta to wp_posts? I used code like this: but get error messge: ERROR 1054 (42S22):
Laravel (Lumen) connect to database on another server on same network
I’ve got a Laravel project on a server, and a Laravel Lumen 8 project on another server, they’re both virtual machines and are clones of one another so have the same hardware and OS. I have a domain, which for the purposes of this Stackoverflow we’ll call foo.com, it goes through Cloudflare, both servers are ipv6 servers and when pinging
Loop through associative array resulting from mysqli_fetch_assoc
I am new in the web development family and I really need help on that problem. The requirement is to get a list of video with their tags. I have 3 tables in the DB – one for videos, one for tags, and one intermediate table video_tags. Here is my query to get datas from DB tables in order to
PHP categories showing only one item
I’m trying to create a categories list, where user will be able to choose item with certain category, but as soon as I’m opening any of the categories, where “soon = ‘2’”, there is only one item coming up. Everything else works. The code bellow is for categories, where user can chose which caegory s/he want to see. Than here
Use of Complex (curly) Syntax in external file
I am having a problem with getting an sql query to interpolate as I would want, and would be grateful for some help please. Within the manual page for pg_query_params,there is a code example for pg_query() passing a variable using curly braces. This appeared to be exactly what I need for my task. So, my code is as follows: The