Insert Data into Database from a Web Form

Поділитися
Вставка
  • Опубліковано 12 гру 2024

КОМЕНТАРІ • 81

  • @rodrigooosouzaaa
    @rodrigooosouzaaa 11 років тому

    I`m from Brazil, and I had spent 3 days searching and learning for what you explained in 11 minutes, ty so much , very good video

  • @greg275
    @greg275 12 років тому

    Thank you for posting this. There are so many inconsistent methods and tutorials out there but yours worked without a hitch. You are my hero.

  • @NielsKersic
    @NielsKersic 9 років тому +2

    Ralph man, you are a legend. You've taught me so much over the last few years, from beginner level html and css to this. When you say things they automatically make sense! Thanks a lot!

  • @chiep07
    @chiep07 9 років тому

    Thanks alot Mr...this kind of tutorial what I search for. Most of tutorial dont teach with the HTML form. You are really my hero Mr..(sorry for my bad English)

  • @khalidQweder
    @khalidQweder 10 років тому

    1 000 000 Thank You Ralph.

  • @ArmaanAgrawalminecraftofficial
    @ArmaanAgrawalminecraftofficial 8 років тому

    EXTREMEMLY EXCELLENT tutorials, these are SO useful!

  • @michelrwekaza3907
    @michelrwekaza3907 6 років тому

    Hi Ralph....Well done! I am so happy to meet your vids. I like the way you explain (I don't know if it's my love of american accent :) ...discovered in late 90'S when I was a student there. Anyway, your way found a way stick things in my little brain. Thanks and please get me the way to your codes. My technique is to listen and watch carefully, then run through your code. Afterwards I do the tricky thing of getting relevance of the learned things with my ongoing "applications development projects"....A warm salute from Stockholm / Sweden

  • @videogamejo
    @videogamejo 10 років тому +12

    You are doing the lord's work. Thank you good sir.

  • @MarcTaylorDJ
    @MarcTaylorDJ 11 років тому

    Thanks for a perfect tutorial, I've been fighting this for the past week, you helped me fix a couple goofy problems!!!

  • @TranThiThaoVan-s1i
    @TranThiThaoVan-s1i Рік тому

    Thank you very much Ralph.

  • @vutelov8344
    @vutelov8344 8 років тому

    Thank you Ralph for such an amazing tutorial ...thank you man

  • @K4rha
    @K4rha 8 років тому

    Thank you very much Ralph, this helped me a lot! Excellent explaining, i've never coded php before and I'm editing the code to fulfill my needs and actually understanding what I'm doing thanks to your explanations :D

  • @topwebz
    @topwebz 10 років тому

    Awesome Job Man!. Thanks so much for taking the time to post this for us

  • @Kakar722
    @Kakar722 13 років тому

    Great that was the thing which i was searching for last 3 weeks thank you very much.you r great thanks again...

  • @swallehnyakamatura
    @swallehnyakamatura Рік тому

    Thanks alot.. you the best

  • @allisonswayze6283
    @allisonswayze6283 3 роки тому

    I was wondering if you could do a multiphase webform to save responses into sql? Like it have multiple tabs? Not a registration form, but almost like survey where it's broken up into parts?

  • @tswaync
    @tswaync 14 років тому

    Thank You! This has been such a help, what a great tutorial!

  • @nathanscovell2895
    @nathanscovell2895 10 років тому +2

    Hello, would you have the source files for this. Every time I hit the submit button it takes me to an error page.

  • @MyPrashanthkumar
    @MyPrashanthkumar 8 років тому

    Great Work... Thank u...!!!

  • @charlenemarais5314
    @charlenemarais5314 8 років тому +1

    Good morning Ralph, only starting coding a week ago, i have followed the tutorial and I only change the names of my tables and fields. The form shows no errors or anything. Can enter data and use submit button, but the 1 record added line doesn't appear when i submit and it also doesn't give me error that it hasn't been loaded. Also doesn't update on mysql. Can i post the code somewhere for you to have a look at please. I know most of these post are from a year ago. Hoping the comment will still get to you. Is there any forums i can join where people can help me. I'm from South Africa and don't know anybody that does coding to ask for help. Also don't have money for courses so I'm doing all the free coding lessons i can find online and all the vids i can get on youtube.
    Other than that thank you. Very nice tutorial. Can understand everything you are saying and doing.

    • @adhithyansundararaj4872
      @adhithyansundararaj4872 6 років тому

      @charlene marais... How did u connect ur SQL database with ur php file .... Help me plzz.... Tnx in adv :-)

  • @josephhaastrup9032
    @josephhaastrup9032 10 років тому +1

    Thanks Ralph, you obviously know what you are talking about.

  • @MuzeTV
    @MuzeTV 15 років тому

    very useful! just like every other video of yours!

  • @riteshvishwakarma6311
    @riteshvishwakarma6311 8 років тому

    thank you Ralph. it was helpful

  • @Muffin_Zini
    @Muffin_Zini 6 років тому

    What if i wanted to use a select in my form and depending on what option i choose from the select it inserts into different tables?

  • @lucabordignon2828
    @lucabordignon2828 4 роки тому

    Hi thank you very much, but I would also have the foreign key. How you do it? Thanks again

  • @McGavel1
    @McGavel1 9 років тому

    Lol, "Sally Struthers."

  • @DialloMday
    @DialloMday 9 років тому

    GREAT TUT! Thanks

  • @andychavez
    @andychavez 11 років тому

    Hi, I like your videos. However, I had a hard time following it in order.
    Is there a way for you to index them so that we know which comes first.
    I end up looking at your videos still confused which should come first.
    each video is still very useful though. But following it sequentially will be very helpful.
    Thanks.

  • @dashbyictfd
    @dashbyictfd 12 років тому

    I have everything working from this tutorial but when I submit a blank form it adds the record to the db so get empty fields in db, is this something I have missed or does your form/DB do same?

  • @ronaldjohnson4470
    @ronaldjohnson4470 10 років тому

    Thank you Ralph

  • @robertcrawford6925
    @robertcrawford6925 7 років тому

    +Ralph Phillips
    Thanks a lot for your excellent tutorial. Unfortunately I'm unable to store the data of a form in a database.
    I'd like to make some preliminary remarks, to give you all the information that can allow you to pinpoint the mistake/s I made: 1) I don't use XAMPP; 2) I use a Linux (Debian 8) Server where I've installed Apache, php and MariaDB Server; 3) The three files with the code below are saved in /var/www/html of my Debian Server; 4) I have a domain which -for privacy reasons- I'm gonna call "domain_name";
    That being said, I report below -in addition to the code- step by step what I've done:
    I've created a form, form_2.php:
    ROUTE:
    ADDRESS:
    LATITUDE:
    LONGITUDE:
    HAZARD:
    RISK:
    I've successfully created a new EMPTY table (newtable) in my "mysql" database by using the code below (create_empty_table.php) and typing in: $ ----@localhost:/var/www/html$ php create_empty_table.php:
    I wrote the file form2_engine.php:

    • @NelsonMarcelin0
      @NelsonMarcelin0 7 років тому

      try this one for sql :)

    • @NelsonMarcelin0
      @NelsonMarcelin0 7 років тому

      $servername = "localhost"; *

    • @robertcrawford6925
      @robertcrawford6925 7 років тому

      Thanks very much.....but typing in $ php create_empty_table.php with the code below:
      1.
      .....I get error messages:
      PHP Warning: mysqli::__construct(): (HY000/1049): Unknown database 'dbname' in /var/www/html/create_empty_table.php on line 8
      ConnectedPHP Warning: mysqli_query(): Couldn't fetch mysqli in /var/www/html/create_empty_table.php on line 25
      PHP Warning: mysqli_error(): Couldn't fetch mysqli in /var/www/html/create_empty_table.php on line 28
      Error creating table: PHP Warning: mysqli_close(): Couldn't fetch mysqli in /var/www/html/create_empty_table.php on line 31

  • @baretings1
    @baretings1 12 років тому

    How do you go about setting a form so that it saves into the database ONLY FOR THE USER LOGGED IN, so like all of the entries are saved to which username added it so in the future a single user might have added 20-100 new sets of the same data into the database fields?
    I would be so grateful if any wise coder could set me straight would save me an immense amount of time.
    Great tutorial btw.

  • @zakufreedom
    @zakufreedom 8 років тому

    what mechanical keyboard you use ?

  • @adancisco
    @adancisco 9 років тому

    I am seeing a lot of people using php but i'm writing a program that is doing the same thing but not using php code. Do you have a video that doesn't use php and instead describes how to do the exact same thing but using servlets

  • @brooksbertelsen9122
    @brooksbertelsen9122 9 років тому +1

    Notice: Undefined variable: newrecord in \database\index.php on line 65 - I see this at the bottom of my page. I have watched your video several times and I think I have your script done completely, but I keep getting this error.

    • @voltage1452
      @voltage1452 9 років тому +1

      +Brooks Bertelsen

    • @stryps511
      @stryps511 9 років тому

      +Lock And Loaded
      hello sir
      can you explain why im getting error Undefined variable: newrecord even i copy whats in video?
      cause there is no error in video tnx hope you reply

    • @rajeevsharma160
      @rajeevsharma160 9 років тому

      +Brooks Bertelsen declare that varialble and initialize with 0 at starting of your php code as like in this video at line 2 eg:

    • @rajeevsharma160
      @rajeevsharma160 9 років тому +1

      +Nivlac Nocsab in this video at line 2 you should declare $newrecord and initialize with zero...............$newrecord="";

    • @adhithyansundararaj4872
      @adhithyansundararaj4872 6 років тому

      @@rajeevsharma160 nd y is that ??

  • @jazmineemiemariegueco
    @jazmineemiemariegueco 6 років тому

    Hi. I just want to ask, when I am establishing a connection between database and php. It gives me error because it doesn't read the $conn. Why is that so? Please help me.

  • @steliosvoskos9610
    @steliosvoskos9610 11 років тому

    I guess you need a control statement for that. The db doesn't recognises it by default

  • @milonham
    @milonham 11 років тому

    thanks for this tutorials

  • @lookkool3
    @lookkool3 11 років тому

    YOUR AWESOME DUDE THANK YOU SO MUCH

  • @SnGrg
    @SnGrg 12 років тому

    THank you very much for your tutorial, u got subbed :D

  • @NielsKersic
    @NielsKersic 9 років тому

    What code should I add to stop people from being able to enter blank fields?

    • @SixMinutesSmarter
      @SixMinutesSmarter  9 років тому +2

      Use a client side java script that looks for empty fields and stops the form (return false) from submitting to the Php.

  • @piyushvishwakarma9339
    @piyushvishwakarma9339 10 років тому

    Thanks a bunch friend.
    You helped a lot. ;-)

  • @dashbyictfd
    @dashbyictfd 12 років тому

    I have the following and it seems to be working but there must be a better way of writing it
    if(empty($_POST['isbn']) || empty($_POST['author']) || empty($_POST['title']) || empty($_POST['price']))
    Any suggestions please?

  • @folklorefrench
    @folklorefrench 8 років тому

    Hi I tried it, but I got errors that the table I was trying to access was read only. How do I fix this please?

  • @joannadamps9480
    @joannadamps9480 5 років тому

    thank you!

  • @mattm14
    @mattm14 13 років тому

    Hi - thanks! Great video!
    However, I get the following message after writing all the code:
    Notice: Undefined variable: newrecord in C:\xampp\htdocs\insert_data.php on line 44 which is the same as yours (?>).
    I don't get the record added message obviously and nothing is added to the database.
    Can anyone advise what I might be doing wrong?
    Thanks!

  • @adhithyansundararaj4872
    @adhithyansundararaj4872 6 років тому

    How did u connect ur SQL database with the php file.... I don't know how to connect : - ( .... Help me here ... Thanks in advance

  • @7hundao
    @7hundao 11 років тому

    how to avoid adding in duplicate primary key entry to the data base?

  • @dashbyictfd
    @dashbyictfd 12 років тому

    You don't updae the id, it should be set as the Primary Key and auto increments, the database takes care of the updating of the id field

  • @muzz88
    @muzz88 7 років тому

    I am so grateful thanks

  • @andrejamarkovic7156
    @andrejamarkovic7156 10 років тому

    THANK YOU. GREAT.

  • @sambelew5805
    @sambelew5805 4 роки тому

    Hello Ralph Phillips , your tutorial is very good but I have an error how do i resolve the problem. would you please help me
    atal error: Uncaught Error: Class 'mysqli_connect' not found in C:\xampp\htdocs\web\Submit1.php:7 Stack trace: #0 {main} thrown in C:\xampp\htdocs\web\Submit1.php on line 7
    Thanks for your help.

  • @Divineorder21
    @Divineorder21 7 років тому

    How is the php if statement at the top being read if it comes before the form? I don't understand how that is working can someone enlighten me?

  • @beelow-Eg
    @beelow-Eg 4 роки тому

    ✅✅✅✅😘😘😘😘

  • @ashishankit9911
    @ashishankit9911 6 років тому

    thanks a lot!!

  • @sarahlaouiz8856
    @sarahlaouiz8856 10 років тому

    THANK YOU

  • @GWILLISIA
    @GWILLISIA 14 років тому

    Thank you, you really save my bacon. X)

  • @galaxyarnold
    @galaxyarnold 13 років тому

    @Zodiaklag try mysql_connect instead :)

  • @mayurgudi381
    @mayurgudi381 6 років тому

    not working !!

  • @nithinpinapaka
    @nithinpinapaka 8 років тому

    can you help me

  • @oldguy8177able
    @oldguy8177able 2 роки тому

    yes thankyou so many videos rubbish