I have a MySQL table called things_they_own with two columns: person and thing and my primary key is the combination of the two. Thus, there are several rows where the first column is a certain person with the thing column being different for each, and several rows where the second column is a certain thing and the first column different
Tag: php
How to use Like statement?
I meet an error like this: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘TANAH’%’ AND a.id_bencana=b….
Codeigniter MySQL filtering data as per user ID in the session
I have following function in my model to select records as per the user ID in the session. public function getOfficer() { $usr = $this->session->userdata(‘id_user’); $userArray = $…
Codeigniter MySQL select max using varchar type value
I want to select max auto_no from the following varchar type column in my codeigniter model +————+ | auto_no | +————+ | 2020-00821 | | 2020-00822 | | 2020-00823 | | 2020-00824 | | …
MySQL SELECT only rows where tbl_col equal to this and that
I am struggling a bit with my SQL query. This is the query i have now, and it works as is, but i want to add some more to it. In the mysql table, there is a column that is named “type”. I want to filter the rows and get the rows with the string “sms” or the string “email”
how to display data on 2 different date ranges
I have the following date data, which is used to display MySQL data parameters and I have the following query: The result I want is that the program will display data from date :$tgaw to date: $tgak Answer You should be using prepared statements here, and also use the MySQL functions to add one month to the upper date in
Cannot use object of type IlluminateDatabaseQueryBuilder as array
I cannot find the error here how do i fix this? $db2 = DB::connection(‘sqlsrv’)->table(‘Checkinout’) ->join(‘Z_MemRecord’,’Checkinout.Userid’,’=’,’Z_MemRecord.uid’) ->select(DB::raw(“…
How to update database after receiving PayPal IPN
I am trying a simple listener to update my user info database (like setting their account type from FREE to PREMIUM) after receiving the PayPal IPN. Upon checking the IPN history, the IPN is successfully sent to my listener but can’t seem to update my database. I wanted to update the user’s account type after VERIFIED part using the SESSION
I need to send id using select in html
I want to show name of the record in select, but I need to send only id of that record. My code: Answer You can send selected value in option
How the db model should be for this scenario? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I’m modeling a database scenario but I’m not understanding properly how to achieve that. The scenario is a user that can