TJ WEBDEV
How to create a shopping cart with admin panel using PHP & MySQL

How to create a shopping cart with admin panel using PHP & MySQL

July 7, 2022
|
PHPMySQL

To learn how to create a shopping cart using PHP and MySQL with an admin panel, then you must check out the playlist embedded below.

In this playlist you will learn, how to :

Some common problems & their solutions

1. “Cannot run query” alert is shown and query does not runs?

It may be because you may have written table or column names in single quotes(‘ ‘).

Eg: "SELECT * FROM 'table_name' WHERE 'columun_name'='value';

The above query is wrong and will not execute because you must write table and column names in backticks ( ).

Eg: "SELECT * FROM `table_name` WHERE `columun_name`='value';

2. Total of an item does not increase on updating quantity?

It may be because you have made some mistakes in JavaScript code.

A. Making spelling mistakes in

document.getElementsByClassName('itotal')
document.getElementsByClassName('price')
document.getElementsByClassName('quantity')

B. Giving a dollar or rupee symbol in the product price.

<input type="hidden" name="Item_Price" value="$852" />

Do not give a dollar or rupee symbol in the item price input field in the index.php page. Write only numbers like this:

<input type="hidden" name="Item_Price" value="852" />

3. Grand total is not showing?

It may be because you have made spelling mistakes in

document.getElementById('g_total')

Make sure you write “element” not “elements” in document.getElementById() function.