I am using laravel 5.7 When I use whereHas to check a relation’s existence, I face with Unknown column “has” in ‘where clause Error! Why? this is my code: $query->whereHas(‘departures’, function …
Tag: mysql
Laravel 6 – SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax;
when I run php artisan migrate to migrate this Schema public function up() { Schema::create(‘transaction_ins’, function (Blueprint $table) { $table->bigIncrements(‘id’); $…
Optimize MySQL FULL TEXT search
I have a search with only one field that allows me to search in several columns of a MySQL table. This is the SQL query: SELECT td__user.* FROM td__user LEFT JOIN td__user_oauth ON td__user.id = …
Question database that doesn’t repeat questions that were answered correctly by user
I have a question table organised as shown bellow: ID | question | a | b | c | d | e | correct_item 1 | What’s my name? | joao | pedro | jose | mateus | …
How introduce anchor links when fetching a url from SQL database using PHP?
This is the PHP script and I can load my data in database but elements in the Link row seems not clickable .so that I redirect the user. My attempt was to add anchor() tags similar to table definition …
Why html page does not read the php page
I have a problem when I click on the submit button there is nothing happened and my data is not being inserted into the database. I’m trying to make a registration page(register2.html) and db_reg.php …
how to put products in loop to show all product
This my product list file in php which i try to show list of all products with the help of https://stackoverflow.com/a/48837052/12033292. My category table name is category and product table name is …
adding line break in string data coming from database in laravel
here the above code is my orders display code I want to add line breaks in product_name which is the string and showing like Hp I7 8th generation, Huawei p30 pro I want to break the line and add the second product which is after the comma in the next row of the table here is the image of how
Laravel eloquent multiple belongsTo seeding
I have three models, User, Category and Article. Article belongs to both a User and a Category where the foreign keys user_id and category_id are not null. Am lost trying to seed the database …
Laravel | Special validation of a lot of data
Validation of a data (1 – 10000 possible rows) So to give some context I am creating a web based mapping interface to map other data formats to our format. Problem Taking an array of data and an array …