Skip to content

Tag: mysql

php – Database value display in multiple table cell based on category

Let us assume the variable $quantity_sum_show value as 8. From the above table, Body,Material,Elastomer row field values are getting from database. I need to display the values based on the category in the table cells. Below is the sql query to fetch hno_count, hno, but confused how to display it in the table…

How to create table with Foreign Keys in Laravel?

I have a users table and a roles table Now I want to create a user_role table which have two foreign keys But I’m getting an error: IlluminateDatabaseQueryException SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your Mar…

Setting up a web application using MySQL

I’m new to setting up a web based application. I have a server with MySQL setup with a database. The site is running my login web page. Currently I have users setup using MyPhpAdmin which will quickly prove burdensome. More importantly, once I run the command “$connection = mysqli_connect(‘1…

How to check duplicate but without refresh page? PHP

this is my coding. I want to check the duplicate data. If duplicate data exists, the alert will pop-out, but once I click on OK, it will go to a blank page and cannot return to the form. How to make it pop-out an alert but without refresh the page? Answer One of the solutions is to do a javascript

MySQL SUM of multiple rows from multiple table

I am trying to get the sum of multiple rows from 2 different tables, but somehow the result returns multiple rows. I need to get the SUM of quotation_item_amount (group by quotation_id) and invoice_item_amount (group by invoice_id) and if I query unpaid quotation, I need to get WHERE SUM(invoice) < SUM(quo…