Skip to content
Advertisement

Tag: php

SQL script behaves differently when run from PHP

I have about 5 million records in a database table (MySQL 5.6), and I wanted to get the last 2 dates, grouped by ID. Looking around the web, I found examples that allowed me to cobble together the following… Running this code from MySQL Workbench, returned 5,700 rows, which is what I expected. I then tried to call this SQL

Data from 2 tables is not displaying on the same page

I’m a newbie in PHP and mySQL, I’m currently working on a profile page where I will display the logged in user’s personal information from one table called users and also display the tours that they will book in the future from my website from this table: booking I’m fetching the data from users table with prepared statement which will

Laravel/MariaDB: errno 150 “Foreign key constraint is incorrectly formed”

I’m on Laravel 5.4, PHP 5.6, Ubuntu 18.04, MariaDB 10.4.8. When I run php artisan migrate, I get: I’m trying to use https://github.com/klisl/laravel-comments. Before trying to perform a migration with this package I had created DB at phpMyAdmin, had configured .env by adding DB name and stuff, had successfully run php artisan migrate, php artisan make:auth and php artisan make:controller

How to replace Over clause in sql version 4.9.5

I am trying to run a query to find the count and percentage of artisan based on gender. The query is running absolutely fine on the SQL server 8. But not on my live server which is 4.9.5. The below is my query. Answer In any database, you should be able to use:

Javascript won’t work properly with my form

So I am currently doing a project for our class, in which I have to display something that I previously stored in a database on a separate page. I chose to display every dataset, as it is the easiest to do. With PHP I implemented a foreach loop which is supposed to show each dataset with a button “EDIT” underneath

Advertisement