i’m working on search engine developement. I’m kinda struggling with an SQL/PHP request. I’m trying to get the highest relevancy score from a search query. It works perfectly on SQL, but not at all on PHP, neither on localhost nor online (while the source code is generated by phpmyadmin itself). Obviously SQL connection works, since other requests are working very
Tag: php
How do store a list of sorted tables with an SQL SHOW TABLES statement?
I am using the following code to show all tables, but how do I store the tables into a sorted array: The following code spits out the data: Answer Put the table names in a PHP array, and then sort the array. And if you don’t nest it in the row, you don’t need nested loops when you process it.
Create a query to select data from MYSQL WHERE min(i_status) = 4
I Have two MY SQL tables OrderTable and itemTable Im recive all orde whit query1 -ResultTable1 – it ok ResultTable1 but I need to receive all orders, goods with which have a minimum status of 4, and the sum of all goods from this order, not only goods with ID = 4 My query should look like this, but it
Trying to do basic subtraction from a database table
I’m trying to subtract data based on user input, for example: UPDATE table SET quantity=quantity – * some input value* This is easy if I’m subtracting field by field, where id=1…2…3, but I want to subtract values automatically when I input quantity, so if input is 60, and there is 50 in the first field, remainder would be subtracted from
Left Join – In Eloquent
I would like to connect user table and like table based on the user_id So I have this Model user.php like.php and my query I would like to return the ‘likes’ table inside the ‘user’ but it doesnt work. I would like to left join it. What am I doing wrong? Answer Well, you need to use one-to-many relation to
SQL Count elements based on newest 150 entries in table
I’m trying to change two SQL queries I have right now so that in addition to giving me a result from a table, it only gives me that result based on the newest say 150 entries within the table. My two …
How to insert array as key => value with string value into sql using php [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 2 years ago. Improve this question I am having just a small problem with the name array, when i perform the above code every row’s member values
Occurrence of a string inside another string
I was wondering if there is an easy way to look for a occurrence of a string inside another string. I’m using this query: $checkfileName[0] will be set in a if-statement, where it’s set to GiM1_0. My problem is that the column doesn’t contain that specific string, only a part of it. Image of sql table So is there a
Unable to show the data in table according to the value entered in serach field [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago. Improve this question This is my table search field. And this my script for getting the data searched by the user. As i
Queries in Laravel – Equivalent to left join
Currently this is my laravel query But unfortunately, I would also like to get the connected data between the company and the user table, user_id for company and id for user this is the table company table: and the user table How to I connect the user under the company array? Answer You need to make a relationship for the