Save HTML Form Data to a MySQL Database using PHP

Поделиться
HTML-код
  • Опубликовано: 21 июл 2024
  • Learn how to create a form in HTML, then save the data from that form to a MySQL database using PHP.
    For a more detailed version of the techniques shown in this video, check out the full course here: 🎓 skl.sh/3tNX25N
    Please consider supporting my channel: ☕ ko-fi.com/davehollingworth
    Recommended hosting:
    davehollingworth.net/hosting
    In this video you'll learn how to:
    - create a form in HTML using best practices
    - create form controls for simple text input
    - use multi-line text input using the textarea element
    - use select lists, radio buttons and checkboxes
    - process the submitted form data using PHP
    - validate the form data using filter functions
    - avoid an SQL injection attack
    - use a prepared statement to insert a new record into a database
    - create a database and table using phpMyAdmin
    - use an SQL INSERT INTO statement to insert a record
    Code shown in the video:
    gist.github.com/daveh/c5a6911...
    Relevant documentation:
    developer.mozilla.org/docs/We...
    developer.mozilla.org/docs/We...
    www.php.net/manual/filter.fil...
    www.php.net/manual/mysqli-stm...
    www.mysqltutorial.org/mysql-d...
    00:00 Introduction
    00:15 Create the HTML file
    01:09 Simple text input
    01:38 Labels
    02:34 Textarea
    03:19 Styling with CSS
    04:19 Lists
    05:49 Radio buttons
    07:36 Fieldset
    08:34 Checkbox
    09:28 Create the PHP file
    11:47 Get the form data
    12:55 Filter the data
    15:04 Validate the data
    16:00 Create the database
    16:12 Create the table
    17:08 Connect from PHP
    19:50 Write the SQL
    20:32 SQL injection attack
    21:00 Prepared statement
    22:08 Bind values to placeholders
    23:42 Insert the data
    24:06 Summary
    #HTML #PHP #MySQL #forms
  • НаукаНаука

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

  • @dave-hollingworth
    @dave-hollingworth  2 года назад +21

    What do you find most challenging about working with HTML forms and PHP?

    • @judgeguilty
      @judgeguilty 2 года назад +5

      Security on the client and server side.

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

      You currently have a course on codeigniter 4 on Udemy. How comprehensive is that tutorial covering features of the framework? I might be interested in that one.

    • @dave-hollingworth
      @dave-hollingworth  2 года назад +2

      @@realchicagophill It's pretty comprehensive - you can access the course here: davehollingworth.net/codeignitery

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

      @@dave-hollingworth I'm half way through it.

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

      The question of how much input sanitization e.g. strip_tags( trim( $_POST['value'] ) ) would be advisable before validation, or rather not using any sanitization at all before input validation.

  • @dryandave
    @dryandave Год назад +29

    This channel deserved more than 8k+ subscribers , hopefully you will not get tired in continuing in sharing your knowledge with us Dave. Blessed you. more power. ❤

  • @rajashreejarande7907
    @rajashreejarande7907 Год назад +4

    Thank you soooo much for this video. I was literally struggling to complete my project based on a similar concept. I referred to 10+ websites and other videos but i finally understood how to actually do this after watching your video. SO a big thank you. Please keep helping people

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

    This video helped me so much! Thank You! I watched so many other videos trying to figure out this topic and you were the first to explain it well enough and show exactly how to complete the steps.

  • @antoniopango1841
    @antoniopango1841 Год назад +5

    Thanks Dave! I'm really impressed how you lecture. You find the right time to explain a concept or parameter. Well done!

  • @someutubchannel69
    @someutubchannel69 2 года назад +15

    Dave is an amazing teacher and Masters PHP, I took one of His courses in Udemy and it was one of the best courses I have ever taken.

    • @FriedrichBoettger
      @FriedrichBoettger Год назад +4

      I'm with you. His Beginner's PHP course was so simple even I understood it. Dave's a cut above most of the instructors on Udemy (though many are knowledgeable). He's got a great and measured speaking voice, knows his subject and takes his time explaining the subject.

  • @jchuillier
    @jchuillier 9 месяцев назад +3

    Usually I need to watch 5 tutorials do be able to do something, you managed to make everything working well on the first try, many thanks for your help

  • @thejoker8705
    @thejoker8705 11 месяцев назад +50

    We had a 1st gen Echo in our master bathroom for listening to music in the morning ruclips.net/user/postUgkxABghAEkaIDGZfHRBH3D3rBrlraNmnC71 and while in the shower. I didn't realize how tinny and awful the sound output on the original Echo was until we replaced it with the Studio. It was a sonic upgrade far beyond what I was expecting. Just wow. I love it because it's like having speakers IN the shower. My friend likes it because the music is so loud that she can no longer hear me singing. So that's a win-win.

  • @earlpatterson6404
    @earlpatterson6404 Год назад +7

    Hi Dave, I am new to PHP and have tried about a dozen different videos but could not get the data from my registration form to populate into my database. Your the first one that I had success. I also learned a lot while I was following along. I hope you decide to do a tutorial on designing a membership login system. Keep up the great work and I appreciate you taking the time to do this video.

    • @dave-hollingworth
      @dave-hollingworth  Год назад +4

      I do have a signup and login system video already, that I hope to expand on soon with a "part 2": ruclips.net/video/5L9UhOnuos0/видео.html

  • @porshkabir2535
    @porshkabir2535 9 месяцев назад +1

    Your content is a life saver. It's really difficult to find content where it takes you step by step process with a good explainaton. after tons searching I found this gold mine :)

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

    Hey, I just watched this video and this was quite helpful to me, Thanks Man.
    Im gonna check all your videos. Love you man. Your discription was way good and understandable.

  • @yherair-jk5qh
    @yherair-jk5qh 2 года назад +1

    Thanks Dave
    I was able to understand and returned back in html, php & sql coding again.

  • @CodeLaniakea-tf5no
    @CodeLaniakea-tf5no 11 месяцев назад +2

    Clear Explanation so I can follow your instruction with no error!
    Thankyou Dave

  • @matheusvieirabloise6387
    @matheusvieirabloise6387 2 года назад +5

    Dave is reference when we discuss about tests, his courses in Udemy are impressive due quality and good modern/up-to-date approaches, principally those about tests using testing framework as phpunit. thank you Dave for always are doing the best for PHP community.

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

    You are a great teacher my friend! Good moderate pace and very well explained.

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

    Thank you Dave!
    You helped me to understand the part that i dont understand to make my coursework :)
    I wish you everything good in life :)

  • @mathdothings
    @mathdothings 6 месяцев назад +1

    This channel is awesome! Thanks for every content you do, I can see how much effort you expend to bring us truly good videos. I know this is beyond this video scope, I'm curious to know which distro you're generally using on your videos showcases?

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

    This is amazing clear nice speed and amazing as usual i really enjoy every one you do.
    Thank you for you work on these !

  • @ravichandrasangam1162
    @ravichandrasangam1162 10 месяцев назад +1

    Excellect video with minute details. Thanks so much for uploading this video. I am sure I will be watching more of your videos

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

    Funny was only thinking yesterday, we must be due for a video.
    Purchased three of your courses on Udemy and found them easy to learn to the point I am cutting code in a major work project

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

    Thank you so much, had a dozen of tries , but no success, and here...my problems are solved any more!!!

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

    Excellent video, the best explanation I've had, thank you.

  • @sathvikthandra8592
    @sathvikthandra8592 Год назад +8

    Saved my day, month ,semester

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

    Thank you very much seriously.
    Simple, focused, and powerful.

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

    Was character binding originally introduced for security? There are easier ways to edit strings and I’m completely new to php [and web dev], kinda curious. Those methods do involve quotes, but the param binding still ends in quotes, so is there a real difference between it and the other string manipulation methods?

  • @ianalfwani7638
    @ianalfwani7638 Год назад +4

    This is the simplest and best explained tutorial on PHP and SQL very very helpful Hollingworth.......... respect

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

    Very well explained and easy to follow, thanks.

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

    Greatest video i've ever seen. You might just be a genius at the process of education

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

    Amazing Tutorial, absolutely life saver!

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

    Superb video, you are calm and composed :)

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

    Great tutorial - thank you very much. You've got a new subscriber!

  • @hakanyargici
    @hakanyargici Месяц назад +1

    You deserve more subscriber!

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

    really excellent, noone could explain it better

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

    Thank you so much Dave! I'm really curious about security of php code as I'm new to it

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

    thanks you for the guide! is there a way to send everything done here to another PC and for it to work the same? including the DB configuration on phpmyadmin? how do i do that? if not what can i do to create a simple page with db to be able to send it to others and work the same as it works for me?

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

    Thank you thank you thank you for all of these amazing videos about php!

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

    Excellent teaching skills!

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

    Your explanation was excellent and sweet and understandable
    thanks

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

    very detailed explanation
    helped alot
    thank you....

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

    Amazing, Love you buddy!

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

    its good precise and to the point

  • @nazareno.marcelli
    @nazareno.marcelli 3 месяца назад

    Best Tutorial ever!

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

    Great job, thank you!

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

    you're a legend!! thanks a lot, sir.

  • @user-xd9ru6pm4l
    @user-xd9ru6pm4l 5 месяцев назад +1

    thank you so much for helping me. I'm a newbie in web development. looking a mentor. :) i will followed you and thank you so much. im from philippines.

  • @Mari_SMS
    @Mari_SMS 5 месяцев назад

    Great job Sir 👏

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

    thank you for your wonderful explanation sir

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

    this video saved me. thanks.

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

    Brilliant video! I am trying to learn how to do this I JavaScript. For some reason I find this easier to do in php..
    If you by chance know about a good resource that teaches how to do this I JavaScript also I would appreciate that:-)
    In the meantime, I’ll stick with this in php:-)

  • @akhileshkumar-iu9uq
    @akhileshkumar-iu9uq 2 года назад +1

    I have subscribed your api course from udemy

  • @thomasmv6440
    @thomasmv6440 10 месяцев назад +1

    Thank u Dave, good

  • @user-ww7yz3mk4w
    @user-ww7yz3mk4w 2 месяца назад +1

    thank you ! helpful

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

    Very nice video you are an absolute help for me 🤠

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

    first i'd like to convey words of appreciation for your impressive work.
    are u using visual studio to write the code or any recommendation for HTML,PHP texteditor?
    do i need to start the mysql server in my xampp before doing all this? or are you using xampp at all in the first place?
    your answer is greatly appreciated. thanks

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      I used Atom for the video, but this has been discontinued now. At the moment I recommend VSCode as an editor. Yes, you need to start the web server and the database server for this to work. I'm using (and recommend) XAMPP.

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

    Hi Dave.
    I am still a bit new to coding but was wondering if it is possible to add a button: "take photo". Can a picture then be taken and added to the mysql database or does this option not exist?

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      You can do this with JavaScript in the browser, e.g. usefulangle.com/post/352/javascript-capture-image-from-camera
      To save it, you'd have to upload it to the server. You don't usually store binary files like images in a MySQL database, what you'd do is upload the file to a folder on the server, and store the filename in the database instead.

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

    THANK YOU SO MUCH!!! :D

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

    Thank you very much sir! God bless you

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

    can you create a search function to pull from the database created via the html form? i am thinking this would be a php funtion

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

    Exactly what I needed. Man, i owe you my college diploma

  • @user-tg4vl8sl3w
    @user-tg4vl8sl3w Год назад

    Hi Dave, thanks for the video I was looking for. Everything else is working fine instead the records are not inserting into message table and there is no error showing in code or error log. Connection to the database was successful.

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      Try using the mysqli_error function just after the code is insterted, and temporarily comment out the line that redirects so you can see the error. Documentation is here: www.php.net/manual/en/mysqli.error.php

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

    Could you please make a video about how to show the stored data and be able to filter it? Thanks in advance

  • @micheldenostredame408
    @micheldenostredame408 6 месяцев назад +1

    This is stuff that i could buy :)

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

    Hi! Thank you for a very nice tutorial, well explained. It works on my server, but not if I copy it to a child theme in wordpress, to submit a form through the rest api. In Postman it seems to work, using jwt auth, but the values are not saved. Any idea why ?

    • @dave-hollingworth
      @dave-hollingworth  2 года назад

      If you're using an API, the data might need to be json encoded, instead of just using the $_POST array. Check out my video on APIs to see how the data is passed using the PHP input stream instead of the $_POST array: ruclips.net/video/X51KOJKrofU/видео.html

  • @yashashreeprabhukhanolkar3277
    @yashashreeprabhukhanolkar3277 9 месяцев назад +1

    thank you so much☺

  • @imlittledoo6969
    @imlittledoo6969 4 месяца назад +1

    is it possible to replace the "echo" at 23:40 with an html page (with css and stuff)?

    • @dave-hollingworth
      @dave-hollingworth  4 месяца назад +1

      Absolutely, just close the PHP with the closing tag ?> and start some HTML

  • @sreevallis7751
    @sreevallis7751 5 месяцев назад

    The data is entered in to php tables is it possible to insert into mysql tables.

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

    Thanks for your wonderful contents. It's really helping me. Please can you make a core PHP tutorial with the Twitter API? Thank you

  • @mojtabaheidari3170
    @mojtabaheidari3170 11 месяцев назад +1

    GREAT VIDEO😄😄😄

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

    thank u very helpful

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

    what shortcut did you use to automatically adjust the indentation in vscode?

    • @dave-hollingworth
      @dave-hollingworth  7 месяцев назад

      Highlight the text you want to indent, press tab (or shift-tab to reduce the indentation)

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

    Thank you.

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

    This video is very insightful. Thank you!
    I ran into trouble when I clicked the button to submit the form. Instead of displaying an array, the PHP code is displayed. I moved the files to the root folder for XAMPP, and received a similar error (error 405, "this page isn't working") until I typed in localhost/[directory]. Hope this helps people with a similar issue.

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

      you found any fix?

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

    Great presentation. When an error is experienced, or the form was completed successfully how do you restart the form entry ?

    • @dave-hollingworth
      @dave-hollingworth  2 года назад

      In this example, you just go back in the browser. If you want to clear the form, you can refresh it by holding down the left shift key while pressing reload.
      In practice you'd probably have some client-side validation in JavaScript on the form, to make sure the form is valid when it's submitted. The server-side validation is just to make sure valid data doesn't get to the database.

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

    It is terrific

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

    Hai, I have a doubt, i have changed the mysql and apache server port numbers, I have printed the values in the aray but can't connect to localhost, need to add any additional codes because i have change the default port numbers

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      You can specify the MySQL port number as the fifth parameter to mysqli_connect: www.php.net/manual/en/mysqli.construct.php

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

    wow thanks a lot!

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

    Hello, I would like to ask a question. I followed the scripting process while modifying the involved data files to fit my own database, however when I press the Send button in the HTML page it redirects me to a page with the php code in plain text and the data inputted isnt saved into the mysql database.
    Is there a way to solve this?
    Much appreciated in advance!

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      It sounds like you're opening the form as a file (in the web browser's address bar it looks like c:\folder\form.html) instead of from a web server - the address in the browser's address bar should be something like localhost/form.html - then when you submit it, the PHP will be executed. If you need a local web server, I recommend XAMPP

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

    Brilliant video!
    Is this possible to do but where the html form is stored in a shared drive and the database is Microsoft access?
    Any guidance on this would be amazing!

    • @dave-hollingworth
      @dave-hollingworth  11 месяцев назад +1

      You can connect to an Access database using PHP, details here: www.infocaptor.com/microsoft-access-database-using-php-pdo-odbc-example
      Although you'd still need a web server to run the PHP code.

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

      @@dave-hollingworth thanks!
      Maybe this could be your next video? Haha

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

    That is awesome Boss

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

    Hello! ive been wondering where can you access phpmylogin because I can't find that certain web. Do I need to download it?

    • @dave-hollingworth
      @dave-hollingworth  Год назад +1

      Yes, you need to install it - if you're using XAMPP, it's included

  • @ilya_123__
    @ilya_123__ 11 месяцев назад +1

    thank you

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

    Hey,
    I have a question. Let's say I want to use one form that is able to insert data into multiple tables, how do you do that? In the tutorial there is only one table that is being inserted with data.
    I can imagine you need multiple variables that have the "INSERT INTO tablename (X, Y, Z) VALUES(?, ?, ?, )" but how do you deal with the $stmt and mysqli_stmt_execute?
    Btw the tutorial was top notch. Learnt a lot from your vid!

    • @dave-hollingworth
      @dave-hollingworth  2 года назад +1

      I replied to this in the code Gist here: gist.github.com/daveh/c5a691136c7e3b81dc8e72b3fc1054b3?permalink_comment_id=4232439#gistcomment-4232439

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

      @@dave-hollingworth Hi Dave, thanks a lot for your reply. You're a great teacher and I subbed to your channel and followed your Github!

  • @aaronargottelopez3488
    @aaronargottelopez3488 10 месяцев назад +1

    thanks!

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

    I'm quiet worried about that select tag (dropdown). Isn't that a bad practice? because user can change it's value through inspect elements. Same with radio button

    • @dave-hollingworth
      @dave-hollingworth  Год назад +1

      You're right, but the same is true for any input element. This is why you need to verify values on the server. Using a select tag is convenient for the user if you want to restrict their choice to a few options. Someone could in theory bypass it, yes, but for most users it's just a simple way to make them choose an option.

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

    Is it only works if you have a website? I mean can I do it in my pc only with vscode?

    • @dave-hollingworth
      @dave-hollingworth  7 месяцев назад

      You need a web server in order for this to work. You can install one with XAMPP.

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

    hi dave ur tutorial was very helpful but I keep on getting an error in line 43 saying that Column 'body' cannot be null how can I fix this?

    • @dave-hollingworth
      @dave-hollingworth  2 года назад

      That means the "body" column in the database table cannot accept null values. Check the value is coming from the form correctly - you can check this by temporarily printing it out and stopping the script before the code that saves it

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

    Great video

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

    17:38 what do we do if we are deploying for production on the internet?

    • @dave-hollingworth
      @dave-hollingworth  2 года назад

      You would have a specific MySQL user that had privileges for just that database. Often your hosting provider will give you these details automatically. More details here: www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql

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

    Nice work

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

    nice tutorial

  • @KnowledgePower-xg5ff
    @KnowledgePower-xg5ff Год назад

    I want to enroll to your course. But im really looking on how to extract data from mysql and display it to html. none of these tutorial here works on newer version of chrome browser.

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      I've tried it in Chrome and it works for me - what exactly is the problem you're having?

  • @DavidThomas-mf3um
    @DavidThomas-mf3um Год назад

    Need help Dave! I get as far as creating the php file and entering the php opening tag and the print statement also putting the action and method attribute inside the form element on the html form doc. Then once inserting the php code in the new php file, I ran/debug the php file and no errors were returned. I input some data in my form and what was returned in my browser was the actual php code from my new php file? not sure what went wrong? I checked the syntax of the code against yours and see no errors. I'm confused! It's as if the form and the php file are not connected. Any help would be appreciated!

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      If you're seeing the PHP code in your browser, it's probable that you're opening the form.html file using your browser as a file browser, i.e. not requesting it from a web server. If the address in the browser's address bar is something like C:\files\form.html then this is the problem. The address should be something like localhost/form.html. To do this you need a locally-installed web server, and you need to put your files in the web server's root folder. If you don't have one, I recommend XAMPP.

    • @DavidThomas-mf3um
      @DavidThomas-mf3um Год назад

      @@dave-hollingworth Thank you for your reply, I had downloaded previously the XAMPP local server but I hadn't saved my files in htdocs folder neither the form.html nor the php code in process-form.php. Even after I saved them both in a folder inside the htdocs folder I still had the similar issues. Finally, I had to pass the complete path of the php file in the action atribute and I had to separate the two files in differing folders . Not exactly sure why but now it returns the array each time. Thank you Thank you for your information. Can you advise me where is a good place to further our knowledge in this area. Especially the proper ways to secure the form and the transfer of data.

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      @@DavidThomas-mf3um I have a full PHP course here if you're interested: davehollingworth.net/phpy

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

    Hi Dave, Thanks so much for making these videos.
    I am having trouble with the mysqli_connect function. It gives me the following error when I run the code: Fatal error: Uncaught Error: Call to undefined function mysqli_connect() in C:\xampp\htdocs\Sample Database\process-form.php:20 Stack trace: #0 {main} thrown in C:\xampp\htdocs\Sample Database\process-form.php on line 20.
    I tried removing the semi-colon from the extension=mysqli line in the PHP program file but still no luck.
    Any help is greatly appreciated.

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      It does look like the MySQLi extension isn't installed or enabled - does your installation contain more than one php.ini perhaps?

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

    sir based in your coding
    in line 4 of form.html and linn 39 of process-form.php you declare it $message while your table in database was body ? how come that those 2 are not same and yet they kind of know each other,...

    • @dave-hollingworth
      @dave-hollingworth  2 года назад +1

      $message is a variable in PHP, "body" is the name of the column in the database. These don't need to match, the value of the variable is assigned to the column when we bind values to the placeholders in the SQL

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

      @@dave-hollingworth sir how a bout a tutorial ADD EDIT DELETE that include database for do you have any video for that ? i want to learn the basic of add edit delete. thank you

    • @dave-hollingworth
      @dave-hollingworth  2 года назад

      @@phelipjdudeparcon6185 I don't have a video about that yet, but it's on my list...

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

    Hi Dave, Nice video tutorial . One small query here, how to run it on localhost?

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      You need a web server and database server installed - I recommend XAMPP if you don't have one

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

    Hi Dave!
    When I submit the form, instead of being processed through the PHP file it just shows me the code from the process-form.php.
    I do have the method="post" in my form, so I really don't know what is going on.
    Could you please help me?

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      Please see this video: ruclips.net/user/shortsl7ERVQd7Ti8?feature=share

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

    What kind of code do I need to make sure you can only make an account if confirm password and password are the same? And where do I put this code?

    • @dave-hollingworth
      @dave-hollingworth  Год назад +1

      Compare the two values from the form to see if they are the same, e.g. $_POST["password"] and $_POST["confirm_password"]. Check out the video on signup as I do that there: ruclips.net/video/5L9UhOnuos0/видео.html

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

    Can you please tell me why I can't even do the very beginning of this because my php files download instead of showing Array([Type]=> 1) I've been trying everything and I have no idea what is causing this.

    • @dave-hollingworth
      @dave-hollingworth  Год назад

      Are you opening your files served from a web server or using the browser as a file explorer? If the address in the address bar of the browser is something like file:///Downloads/form.html then this is why - the address needs to be something like localhost/form.html. If you don't have a web server installed, I suggest XAMPP.

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

    hello dave it not showa data in array and that's problem i am facing

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

    Hello Sir, thank you very much, it seems quite simple for a begginer, i have a question. I do not have PHP application installed in my computer. Thats why the .php file is not working right?

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

      could you please specify what sofware do one need to install? Please!!

    • @dave-hollingworth
      @dave-hollingworth  2 года назад +1

      @@3101199 I recommend XAMPP: www.apachefriends.org/

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

      @@dave-hollingworth thank you