Skip to content
Advertisement

Tag: php

Excluding overlapped period in doctrine QueryBuilder

I have Product and Booking entity and I’m trying to select products that aren’t already booked in a given period. In other words, to select available products during a given period. To make myself understandable, see the schema below. I only want to select product that have a booking like #1 or #5 since it is available. If a product

How to convert SQL query in laravel query?

I know this question is not asked in a well manner way,so I am sorry,I have SQL query this one I want to convert it in PHP laravel query form so tried this query but I don’t know SQL and even I am not understanding how I convert it, can someone help just convert SQL query to laravel query? here

Php – cannot create new database record because primary key is null (autoincrement)

There are two tables: address and person. person_id (primary key, autoincrement) is a foreign key to address. I am trying to add an address record and person record from the same form but am getting this error. Uncaught Error: Attempt to assign property “person_id” on null in C:xampphtdocsappcontrollersMain.php:22 Stack trace: #0 [internal function]: appcontrollersMain->insert() #1 C:xampphtdocsappcoreApp.php(52): call_user_func_array(Array, Array) #2 C:xampphtdocsindex.php(4):

I wanna create a new table from the data of two tables

I have a A table to store the product name, the quantity and input day of goods in stock. In adverse conditions, invoices for the above products will be sent later. I will put the product name and invoice quantity in B table. The problem here is that I want to check the quantity of goods with invoice and without

How to improve a mysql COUNT query for speed?

How can I improve this query for speed? at the moment it’s taking a couple of seconds only to load the php file where the query is without even querying anything. I’ve an index on skillsTrends, jobtitle and industry. Collation: utf8mb4_unicode_ci Number of records < 1,000,000. Answer Try this covering index. It should help the performance of your query. And,

Insert price to the pivot table

I am trying to insert data to a pivot table order_serrvice using arrays I follow this code: https://blog.quickadminpanel.com/master-detail-form-in-laravel-jquery-create-order-with-products/ the column qty and service was inserted properly but the price does not, I dont know why? order_service table: OrderController: with dd($request): dd($price[$service]) Data base outbut Can any one help? Answer In your controller, you are misusing the attach() method: The attach()

Advertisement