How can I make if player X has the same number of points as any other player, so that it displays them in 1 row? table users: `uid` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(120) …
Tag: mysql
Push data to a parent array from within child array (PHP)
I have an array of baseball teams and within each is an array of that team’s seasons. Within each season is the number of wins in that season. I would like to tally up all of a team’s wins and then …
Error Call to a member function attach() on null
I want to create tag system but I have an error “Error Call to a member function attach() on null “. Look at my code Relationship: Job.php public function services(){ $this->…
update batch in codeigniter
I have data on db_temporary here I will update based on id_service, but why doesn’t the update work? public function updateUpload() { $db = $this->M_order->db_temporary_service(); //…
Check if Coupon exists and if it is the first order
In my e-commerce I have implemented coupons, and it is working, but now I introduce “Coupons first order”, but don’t know if I’m doing the best way to check it, because it is not working, my query is …
NEWID function causing error for prepared statement in MYSQL
I am trying to create a forgot password system, so I am using the NEWID() function to create a random code to be sent to the user’s email. I am using prepared statements to prevent SQL injections, but …
Finding Average Time for Created At and Updated At – PHP & MYSQL
I have a table to which has created_at and updated_at. Created at is when the client purchased the order and the updated_at field is updated when the order is approved like below. I want to get the …
Call to undefined method links()
I’m trying to display featured game in my home page but i’m getting the error : Call to undefined method IlluminateDatabaseEloquentBuilder::links() when i’m changing in the HomeController : From …
How to create an optimized sql query for multiple dropdown filtering in php?
Am new to php and working on a project. At the beginning there was 2 filters for which I didn’t worry much in writing the sql query with 4 conditions. But now I’ve 8 different dropdowns and I need to …
Doctrine query builder – where IN with non string column names can’t be generated
I can’t sleep because of this, I either must be missing something really obvious or it can’t be done like that. I have this Doctrine Query Builder thingy: $this->queryBuilder ->…