I want to join 3 tables named members, students and baseinfos. And baseinfos holds some id as bas_id and name of it is stored in bas_value: And this is my code: But this is wrong and shows me this error: Note that I can not say this: Because degree.bas_value will overwrites gender.bas_value! So how can I join these 3 tables
Tag: join
Need help in joining two tables from mysql database for a photography project
I am working on a photography project and I am facing a bit issue with joining tables and retrieving data from mysql database. I have created two tables for this project. One table named cm_team is for team members and another table named cm_events for photography events..Assume to shoot a event, we require 6 persons and the id of the
How to update a column by joining four tables in laravel
I have four tables default_products_product_mileage_gap default_products_mileage_gap default_products_products default_products_products_mileage_gaps I am trying to update a column number_of_products_sold to some value using laravel What I have tried is: Here number_of_products_sold is not updating. How to update the column Answer Why you want to add four table together. here is an example to add or update multiple table from by controller.
PHP insert br tag after 2nd Word of a Given String
I’m trying to insert <br/> tag after 2nd word of a given string, but it crops some words of my string, can anyone help to fix the code on this Answer You can use array_splice :
Cannot union two Joints Laravel
Im trying to union 2 joins, but im getting weird error… I have “Clientes” -> means clients, and i got all the clients that they got registered in orders and news. In news table i got the cliente_id -> client_id , And in orders, i got the same, cliente_id -> client_id, In news i got x clients, and in orders
Problems when using join and pagination together in Laravel
I have some tables in my database and I’m trying to transact between them. My aim is to show the project name and the employees in that project in the form of cards on my projects page as in the image below. (Other than the method I mentioned, if there are better ways to do this, I ask you to
use group_by in codeigniter to get latest data
I am new to CodeIgniter. I have seen similar threads related my question, however I am unable find an exact solution. I have a table ‘request’ which contains two columns, one with ‘userId’ the other …
Looping to find nearly matching file names separated by a few seconds
I’m quite new to SQL and my database design is probably quite poor, however I would appreciate some help attempting to match files. The Project: A video camera records an image file and video file …
how to change null value to zero
values of columns that is empty returns null. How to I make turn the null to zero so that if the value is null it returns zero. public function getThumbsUpAttribute($value){ return $value !== …
PHP MySQL – get comment count for all posts written by one user
My aim is to get a total count of ‘pending’ and ‘approved’ comments for all posts for a specific user. The comments table has a status column for ‘pending’ or ‘approved’. For the record, the page_id in the comments table maps to the id in the posts table. I started writing the statement below – but I think I have