inserting data into two db tables using php

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

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

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

    Thank you so much for this. Been looking for this fro 2 months! You got yourself another subscriber. Bravo

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

    thank you so much for this video bro, finally got the answer for my problem👍👍👍👍👍👍👍👍👍👍

  • @kotimunkansi3055
    @kotimunkansi3055 4 года назад

    This video was very helpful... i had lost so much hope in finding a solution

  • @justgotravel6646
    @justgotravel6646 2 года назад +2

    I guess you never heard the concept of relational database.
    How would you be able to link the user to the message? The way you do it would be a mess. If a message record is deleted/wrong inserts you would have a mismatch in primary keys. Furthermore if you later on want to extend with more tables then all the autoincrement keys are not in sync.
    I suggest you add userid column to the message table. Then you need to insert the user in first SQL insert, have the new user ID returned (you can do this in PHP), do the second SQL2 query adding the message and userid to the message table.
    With this method you can have several messages for the same user record.
    And now you have a relationship - Relational Database.

  • @dennischarles4384
    @dennischarles4384 3 года назад

    Thanks indeed, your contribution is the best!

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

    May God bless you

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

    Boss kindly do a tutorial on a foreign key, relating two tables together on a database

  • @sharthakrai4482
    @sharthakrai4482 3 года назад

    just the video I needed for my assignment! thanks

  • @samtadhanve8539
    @samtadhanve8539 3 года назад

    Thank u so much it's help me lot..

  • @niwamicha226
    @niwamicha226 3 года назад +1

    thank you so much for this tutorial , can i you please do it for the foreing key

  • @aymanechnaif9308
    @aymanechnaif9308 3 года назад

    Thanks for the video it was great

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

    great but i have a quest, how can we put the id the same i mean in the messages table the id should be the same to the id of the table user

  • @priyankasawant2083
    @priyankasawant2083 4 года назад +1

    thank you man thank you so much its help me a lot.

  • @Shr3zza
    @Shr3zza 3 года назад +1

    Hi How would i do this if I wanted to insert it into 3 different tables ?

  • @marigiyvonne294
    @marigiyvonne294 3 года назад

    Very Helpful

  • @Giangbpro
    @Giangbpro 4 года назад

    Gracias me ha ayudado mucho

  • @balogunsemako1912
    @balogunsemako1912 3 года назад

    Nice Video Bro
    how can i insert into two db table base on gander select

  • @kainatit4649
    @kainatit4649 3 года назад

    I wanna use database tables as options in drop down menu to insert data of different semester's student into different separate tables. how can I do this?

  • @afrikblog5162
    @afrikblog5162 4 года назад +1

    Sir please I will really appreciate it if you could do a video on how to insert into a table that has a foreign key constraint and also teach on auto date with php ..which means when a user click on the submit button they should be a auto date of the registration

    • @petermsomphola4497
      @petermsomphola4497 3 года назад

      on auto date just create current timestamp in your database

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

    hi, how do you do for auto increment unique id (same for 2 tables in database) so that we know based on the same id (connected between 2 table)? really appreciate your help on this . thanks

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

      I suggest you add userid column to the message table. Then you need to insert the user in first SQL insert, have the new user ID returned (you can do this in PHP), do the second SQL2 query adding the message and userid to the message table.

  • @0sawelucky815
    @0sawelucky815 3 года назад

    Thanks

  • @mouradmessaoud7440
    @mouradmessaoud7440 5 лет назад

    hello, it's beautiful I understood everything but I ask you a query that is inserted in two tables with recovery of identifier auto increment after each request, then inserted into the third table, thank you very much and good continuity.

  • @akhilkazi1454
    @akhilkazi1454 4 года назад

    Hello sir please update a video as price qty total with inserting to database.

  • @abrakadabrajordan5184
    @abrakadabrajordan5184 4 года назад

    I tried this code and it worked, although the second time it did not work, and then after that it never worked again, can anyone explain this?

  • @anxious3350
    @anxious3350 3 года назад

    Its always failed, why ?

  • @therandompostguy
    @therandompostguy 4 года назад +2

    I was thinking you could do this project for me. Do provide your email so we can talk privately.

    • @zegitalacademy6281
      @zegitalacademy6281  4 года назад +1

      zegitalmedia@gmail.com

    • @therandompostguy
      @therandompostguy 4 года назад +1

      @@zegitalacademy6281Thank you so much for replying, I have sent you an email.

  • @gokulg2756
    @gokulg2756 3 года назад

    Code plz