PHP Using a For Loop to do a Multi Row Insert into Mysql DB

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

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

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

    dr. Marshall, i appreciate how you’ve made a very comprehensive video explaining the basics of web development. i find this content extremely helpful. i would be grateful if you uploaded more

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

    Cheers mate, appreciated. Literally as soon as I saw the array [ ] at the end of the consistent name it made sense. I was trying to work out how i would be able to make a form with unique identifiers for all of the info haha. i.e. ID1, ID2, ID3. So much easier to for loop :)

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

    Thank you very much

  • @connectwithvictorbassey
    @connectwithvictorbassey 5 лет назад +2

    Wow, thanks a`bunch, I've been on it for about 3 weeks now

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

    Great video :-)
    One suggestion: it will be better for your application to take whole line '$sql="INSERT into ..." before FOR loop and insert all values in one go. You can use syntax:
    INSERT INTO table fund (tickerSymbol, quantity, price, date, accountid) VALUES (tval1, qval1, pval1, dval1, aval1), (tval2, qval2, pval2, aval2), (tval3, qval3, pval3, dval3,aval3), ....
    It is much faster and uses less database resources.

  • @ErenYeager-qh3rl
    @ErenYeager-qh3rl 3 года назад +2

    I am beginner and doing a project where I need to multiply (price*quantity = value) same like yours and to (add all value) and display as (total)...I am using php and MySQL. But I don't know exactly how to do even after watching video please help me...🥺

  • @noviardi86
    @noviardi86 5 лет назад +3

    Hi Dr. Bryan..
    It would be so helpful if you provide the source code for beginner like me..
    Thanks

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

    hopefully tou can also share us the source code, especially to those beginners

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

    Hi,thanks for the video.i need your help. I want to update all rows in table1 (db1) to table2(db2) using php code. I will task scheduler to run the script. The script picks only 1 row with the highest id.let us say.row1 is 1300 row 2 is 1304,row3 is 1309.it picks only row3 which 1309.if i delete row3,it picks row2. There is something i am missing the code

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

    Hello sir may make video, create menu that normal user can edit and add

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

    Hi thank you Dr. Bryan. Please on the detail.php page, could you elaborate a little more on line 36 (couldn't see well) but this: Fund::$database->query($sql). I was doing something similar but I wrote mysqli_query() instead but it gives me error.
    thanks in advance

    • @essanauman4345
      @essanauman4345 5 лет назад +1

      @Kofi Tesla1 Hey I used mysqli_query() as well and it works for me pass two parameters in it and it works fine. Just write it as mysqli_query($conn,$sql); $conn is the connection that you established to your database and $sql is the query.