E-Commerce Website using PHP and MySQL || Updating Quantities || Part -31

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

Комментарии •

  • @KhanamCoding
    @KhanamCoding  2 года назад +1

    🚀Get access to full PHP CRUD project.
    www.udemy.com/course/learn-php-crud-operation-create-read-update-and-delete/?referralCode=4C91E67AB34784662E54
    🚀Registration system using PHP and MySQL
    www.udemy.com/course/registration-and-login-system-using-php-and-mysql/?referralCode=F96D572ED43994DAD56F
    *******************************
    👉Instagram: @khaiserkhanam
    instagram.com/khaiserkhanam/

    • @omidyshirazi
      @omidyshirazi Год назад

      hi hope you're doing great I'm glad to know u and now I'm doing the same and watch every single video u made in this category but now i want to import my data into my laptop's xampp but i got some error and my data didn't import can u make a video about it how i can export and import this project i made with in another device

  • @boudjellalroudeina
    @boudjellalroudeina Год назад +3

    Try to make the type of input quantity as number it will works

  • @EllantEladar37
    @EllantEladar37 2 года назад +3

    I Somehow found a way Thank God Almighty. And teacher Kaisher Khanam I am thankful to God that these videos you've posted have already included the solutions from start to end. I just found a way how to specifically get the specific item quantity of each no matter if it's 2 or 99 items was in cart, I can specifically change the quantity connected to cart_details database table. Thank you so much and I hope you would post more of videos like this since this is a HUGE Diamond in the rough. I could never learn more enough from start to end. I was able to make the admin login page and registration with the IP address including except the add to cart features on admin.

    • @saintseer8214
      @saintseer8214 2 года назад

      trying to figure that out as well. what did you do?

    • @thalessolomon8527
      @thalessolomon8527 2 года назад

      Can you please, paste the updating cart quantity solution here.
      Thanks

    • @Aya-df5hr
      @Aya-df5hr 2 года назад

      can u pls teach us how

    • @Celine9929-1
      @Celine9929-1 2 года назад

      bro can you share the code with me

    • @jirayathegallant5059
      @jirayathegallant5059 Год назад

      Pls comment the code I really need this solution 🙏🏻

  • @mangeshthorat9427
    @mangeshthorat9427 2 месяца назад

    Yea guys ,i know that many of us got stuck here in this video ,so i did lot of searching and found out that when you tell chatgpt to correct this code or solve error in this code, it will give you a code containing cart_id in it ....the thing is that you have to drop the primary key from product_id, create a column in cart_details table and give the primary key and auto increment to cart_id .hope it works for you all .i did this and it worked for me

  • @_cooleststar_
    @_cooleststar_ Год назад +2

    For those who are stuck maybe try removing all the items in your cart first, I previously had 4 items in my cart and it prompted me the error. Then I decided to go remove and add just 1 product and it worked. (I pray that she'll spot and fix the error in the later part)

    • @bruisinflare
      @bruisinflare Год назад

      did you solve the issue when updating specific products?

    • @_cooleststar_
      @_cooleststar_ Год назад

      @b nope that's a error she never fix

    • @bagthavachalanucavasu
      @bagthavachalanucavasu 10 месяцев назад

      function totalSavedCard(){
      global $con;
      $ip = getIPAddress();
      $select_query="Select * from `cart_details` where ip_address='$ip' ";
      $result_select=mysqli_query($con,$select_query);
      while($row_data=mysqli_fetch_assoc($result_select)){
      $productid=$row_data['product_id'];
      $quantity=$row_data['quantity'];
      $select_queryP="Select * from `product` where id=$productid ";
      $result_selectP=mysqli_query($con,$select_queryP);
      $row_data=mysqli_fetch_assoc($result_selectP);
      $name=$row_data['name'];
      $image1=$row_data['image1'];
      $price=$row_data['price'];
      echo "
      $name


      $price /-




      Remove
      ";
      }
      }
      function updateCart(){
      if(isset($_POST['update'])) {
      global $con;
      $ip = getIPAddress();
      $quantity = $_POST['qty'];
      $product_id = $_POST['product_id'];
      $update_query = "UPDATE `cart_details` set quantity = $quantity WHERE product_id = $product_id and ip_address='$ip'";
      $result = mysqli_query($con, $update_query);
      if($result) {
      echo "alert('Quantity updated successfully.$quantity $product_id' )";
      } else {
      echo "alert('Error updating quantity: " . mysqli_error($con);" )";
      }
      }
      }@@bruisinflare

    • @SathishKumarL
      @SathishKumarL 7 месяцев назад

      Yeah bro me also having this error

  • @rakeshradhakrishnan4870
    @rakeshradhakrishnan4870 Год назад +2

    Only the last quantity that we entered will be taken as input and will update every product in cart database with the last value.. If we have multiple product in cart then your last quantity input field data will be taken

  • @yassinebenmustapha2160
    @yassinebenmustapha2160 2 года назад +3

    when there are 2 or more items in the cart and you try to update only one item all other items get updated too

    • @kawaiicoded
      @kawaiicoded 2 года назад

      Yep, that's what happened for me. When I tried to just update 1 item in the cart it updates all the items in the cart! At least I have a better understanding now!

    • @EllantEladar37
      @EllantEladar37 2 года назад

      I too have this issue. and I don't know how to update if it has multiple items.

    • @marwanassou4016
      @marwanassou4016 Год назад

      yes that's what i think if you try to update quantity for an product all products get updated

    • @yassinebenmustapha2160
      @yassinebenmustapha2160 Год назад

      @@marwanassou4016 I tried fixing it for a week but sadly couldnt manage it so I just removed the quantity option all together

    • @IamBinhod
      @IamBinhod Год назад

      @@marwanassou4016 bro are you solve the problem i'm stuck with it now

  • @missinglink2416
    @missinglink2416 9 месяцев назад

    Hi Ma'am, I observed the new value(after quantity has been change) does not reflect into navbar total/sum price. so when changing to new page, like going back to the home page, the value it display still from the single quantity.

  • @bhuvaneshwari.b.g3637
    @bhuvaneshwari.b.g3637 Год назад +2

    Mam updating the quantity fatal error occurred when multiply $total_price=$total_price*$quantities;
    The error shows int*string not supported in php
    How to solve the issue

    • @VendarMohammed
      @VendarMohammed Год назад

      I also get this error, did you find a solution?

    • @bhuvaneshwari.b.g3637
      @bhuvaneshwari.b.g3637 Год назад

      @@VendarMohammed you can convert this quantities into integer then u can multiply this value $quantities = intval($quantities);

    • @mdehsanulhaque4012
      @mdehsanulhaque4012 Год назад

      @@bhuvaneshwari.b.g3637 not working this can you please share a peice of that part of code please

    • @globalexpresszone5363
      @globalexpresszone5363 11 месяцев назад

      pls vai help me....same problem this vedio

    • @bhuvaneshwari.b.g3637
      @bhuvaneshwari.b.g3637 11 месяцев назад

      @@globalexpresszone5363 check with chatgpt paste the part of code and post the error hope it will helps you am also follow the same way

  • @godwinizekor7183
    @godwinizekor7183 2 года назад

    Please what is the advantages of using add to cart with cookies over ip_address

  • @ziaullahshah1209
    @ziaullahshah1209 2 года назад +1

    mam u r great but here is problom in multiple cart if u r updating only one in it cant updating any sulotion plz

    • @vikrambais4885
      @vikrambais4885 2 года назад

      if you found the reply plz respond here

    • @rasikaeranda3738
      @rasikaeranda3738 2 года назад

      .myupdatebtn{
      width: 100%;
      margin-top:10px

      }

    • @rasikaeranda3738
      @rasikaeranda3738 2 года назад

      .myupdatebtn{
      width: 100%;
      margin-top:10px

      }

    • @vikrambais4885
      @vikrambais4885 2 года назад

      @@rasikaeranda3738 wow amazing u saved me thanks alotnow i understood u r code .

    • @cleint9605
      @cleint9605 2 года назад

      @@vikrambais4885 Can u help me on this problem?

  • @VendarMohammed
    @VendarMohammed Год назад +2

    This error shows what the solution prof :
    Uncaught TypeError: Unsupported operand types: float * string in

  • @P_Ahir11
    @P_Ahir11 8 дней назад

    Video no 31 , line number 128 [ $total_price=$total_price*$quantities; ] this is not work and error, Error is ->Fatal error: Uncaught TypeError: Unsupported operand types: int string in C:\xampp\htdocs\Ecommerce website\cart.php:140 Stack trace: #0 {main} thrown
    in C:\xampp\htdocs\Ecommerce website\cart.php on line 140,this is the error please solve this please 🥺

  • @mohanraj-om6gx
    @mohanraj-om6gx 2 года назад +1

    Pls make videos only in English mam than only everyone can understand. P.S I am tamil

  • @cleint9605
    @cleint9605 2 года назад +1

    Can someone help solve this issue of updating quantity?

  • @vinaykshirsagar62
    @vinaykshirsagar62 2 года назад

    Suppose , we add 2 items in cart and I want to update the quantity of only one item then it's not updating ,it is updating the quantity of both items ,pls tell us how to solve this error and also I want to display the quantity in cart .there is 1 more error whenever we refresh the cart it shows the default quantity again and again . Please tell us about it.

    • @KhanamCoding
      @KhanamCoding  2 года назад

      While updating u can do one thing in where clause along with ip address give product Id as well using and operator..if both this are true then only cart item will be updated. Check for this.

    • @vinaykshirsagar62
      @vinaykshirsagar62 2 года назад

      @@KhanamCoding still the same error

    • @MuzTVForever
      @MuzTVForever 2 года назад

      @@vinaykshirsagar62 U solved this error?

    • @anirbanadhikari7999
      @anirbanadhikari7999 Год назад

      @@KhanamCoding still same problem...can you please make another video to solve this problem?

    • @Error_code304
      @Error_code304 8 месяцев назад

      you find the solution for this one

  • @ByteCraft-nc6dz
    @ByteCraft-nc6dz Год назад

    Maam you missed the part 30

  • @a_mondal08
    @a_mondal08 2 года назад

    U must check once again ur updating cart video,,there are more error coming while I practice

    • @rasikaeranda3738
      @rasikaeranda3738 2 года назад

      .myupdatebtn{
      width: 100%;
      margin-top:10px

      }

  • @matthewsoenarjo6411
    @matthewsoenarjo6411 Год назад +1

    Found a way to solve the updating problem from this link

    • @bruisinflare
      @bruisinflare Год назад

      can you share me the solution pls

    • @generalknowledge123
      @generalknowledge123 11 месяцев назад

      I am also want the solution please share with me also brother

  • @ManichSakmai
    @ManichSakmai Год назад +2

    For anyone who can't update the quantity.

  • @memegame3834
    @memegame3834 8 месяцев назад

    im having this annoying error Fatal error: Uncaught TypeError: Unsupported operand types: int * string in D:\XAMPP FILES\htdocs\EcommerceV3\cart.php:131 Stack trace: #0 {main} thrown in D:\XAMPP FILES\htdocs\EcommerceV3\cart.php on line 131 anyone know?

  • @tarnumsayyad
    @tarnumsayyad Год назад

    30 no video is missing from this playlist 😢

  • @jirayathegallant5059
    @jirayathegallant5059 Год назад +1

    If anyone found the solution of updating cart quantities pls comment the code I need this 🙏🏻

    • @generalknowledge123
      @generalknowledge123 11 месяцев назад

      Bro my problem is also same
      So, if you got the solution then please let me know also.

  • @TyonPlex
    @TyonPlex 4 месяца назад

    I have an error

    • @KhanamCoding
      @KhanamCoding  4 месяца назад

      Could you please brief about your error.

  • @thalessolomon8527
    @thalessolomon8527 2 года назад

    Someone should help solve this issue of updating quantity..
    Please paste in the comment, thanks

    • @rasikaeranda3738
      @rasikaeranda3738 2 года назад

      .myupdatebtn{
      width: 100%;
      margin-top:10px

      }

    • @devesh.dev008
      @devesh.dev008 2 года назад

      if(isset($_POST['update_cart']) && isset($_POST['quantity'][$product_id])){
      $qty = $_POST['quantity'][$product_id];
      $update_cart = "update `cart_details` set quantity=$qty where product_id=$product_id";
      $result_products_quantity = mysqli_query($con,$update_cart);
      $total_price = $total_price*$qty;
      }
      ?>

  • @Kpkaushal23
    @Kpkaushal23 2 года назад

    Please make it in Hindi so many people can join u

  • @RD28200
    @RD28200 2 года назад

    hello, i had the same error as you, i did what you did and i'm still getting the error: Fatal error: Uncaught mysqli_sql_exception: 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 'where ip_address='::1'' at line 1 in C:\xampp\htdocs\WebSiteParaiso\carrinho.php:140 Stack trace: #0 C:\xampp\htdocs\WebSiteParaiso\carrinho.php(140): mysqli_query(Object(mysqli), 'Update `carrinh...') #1 {main} thrown in C:\xampp\htdocs\WebSiteParaiso\carrinho.php on line 140

    • @ace4452
      @ace4452 2 года назад

      i got that issue too, please help me if you got the right code

    • @Celine9929-1
      @Celine9929-1 2 года назад

      @@ace4452 do you slove the issue ?

    • @stephennwobodo4906
      @stephennwobodo4906 Год назад

      Pls am having same issue pls I need help

    • @bagthavachalanucavasu
      @bagthavachalanucavasu 10 месяцев назад

      query syntax error only please check one more time query syntax or paste query in comment box