22 | INSERT INTO Database Using PHP From Your Website! | 2023 | Learn PHP Full Course for Beginners

22 | INSERT INTO Database Using PHP From Your Website! | 2023 | Learn PHP Full Course for Beginners

Dani Krossing

1 год назад

81,281 Просмотров

Ссылки и html тэги не поддерживаются


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

@Gupatik
@Gupatik - 26.01.2024 23:38

Okay, now this channel is a true real gem for me, it has everything. Maybe it will affect the algorithm a little bit, but that's not all the point of this, the true thing that matters is the lives you have changed with this golden information.

Ответить
@Tense2006
@Tense2006 - 29.01.2024 17:21

does anyone know why after i do $stmt = $pdo->prepare($query);
the rest of the things turn into html

Ответить
@Stash.J4d
@Stash.J4d - 29.01.2024 22:51

For health reasons? are you okay? We hope your as healthy as possible at the time.

Ответить
@JXDfr
@JXDfr - 30.01.2024 21:16

Hey dear! How may i save images as well as display images? I dont think pgpmyadmin svars images? I am looking forward to nobody but your help. Thank you!

Ответить
@0xVoid_
@0xVoid_ - 31.01.2024 16:33

Man, for people like me that are Interested in Cybersecurity and particularly pentesting, this channel is GEM ! Appreciate the fact that you explain the security side in depth. I learnt so much from these videos.

An idea for you Dani you might consider, a playlist focusing on securing the website based on OWASP TOP 10.
It will be another gem in your list.
Thank you!

Ответить
@theanonymous41
@theanonymous41 - 10.02.2024 19:20

great tutorial. Hope you're good man

Ответить
@delta13dek
@delta13dek - 05.03.2024 19:30

You mentioned you cut your hair for health reasons, I hope you are doing well today!

Ответить
@HighfieldFarm-w1z
@HighfieldFarm-w1z - 07.03.2024 04:58

I’m trying to learn to do his right so its really frustrating to spend a lot of time typing in code and trying to figure out what it is doing only to have you say, but this is not the way we should do it. I don’t care how we shouldn’t do it, only how you should.

Ответить
@akashgola2153
@akashgola2153 - 15.03.2024 21:36

Like everyone said in the comments, keeeping it simple is the best , also there are viewers from other countries who r not native english speakers hence i believe keeping the english as simple as possible is definitely the way to go . Great Vid.

Ответить
@wasdaletimelapse7658
@wasdaletimelapse7658 - 21.03.2024 15:46

Hi Dani, I have just come across your excellent video whilst searching for a solution to passing data from an ESP32 sensor into an SQL database. I have very limited knowledge of this kind of subject but I am able to follow your instructions very easily but I would like to know if I can use this method to pass the data instead of from a web form but from an ESP32 sensor. I have already tried several solutions but I keep getting stuck at the point of passing the sensor data to the .php file. Again, due to my complete lack of knowledge and understanding of this subject I just seem to be going around in circles. I would really appreciate any pointers you could give me. I will try and follow your PHP full course videos to help me better understand. Thanks in advance.

Ответить
@Zahra-j7t8k
@Zahra-j7t8k - 23.03.2024 13:26

Thank you, very good job

Ответить
@tejaspathak933
@tejaspathak933 - 24.03.2024 05:34

Thanks a lot Dani!Awesome Tutorial series :) Please take care of your health!

Ответить
@new-in8yt
@new-in8yt - 29.03.2024 15:30

thank you so much and i have a question
what is the deference between this


$query = "INSERT INTO users (username, pwd, email) VALUES (?,?,?);";
$stmt->execute([$username, $pwd, $email]);

and this

$query = "INSERT INTO users (username, pwd, email) VALUES (:username, :pwd, :email);";
$stmt->bindParam(":username", $sername);
$stmt->bindParam(":pwd", $pwd);
$stmt->bindParam(":email", $email);

$stmt->excute();


and which one better or when we use they ?

Ответить
@DharmYogi
@DharmYogi - 30.03.2024 08:54

Dani Thank you for your lessons. I learned a lot. I just created my sample form and now I will work on creating the real one. I manage to get the database connection part working and loading the data. So I am quiet happy as to how far I got. Thanks again.

Ответить
@neilakrika9964
@neilakrika9964 - 01.04.2024 13:38

thank you for your efforts , better than uni lectures

Ответить
@ColorfulWonders
@ColorfulWonders - 03.04.2024 20:04

I followed this tutorial to the letter but for some reason my database isn’t updating when I use the form. There no error message, so I’m not sure what the problem is. I’ve gone over this video and my code multiple times, I’ve restarted my computer and everything, still doesn’t work. I have no idea why. Help? Love this video series btw.

Ответить
@LiezelHebbert
@LiezelHebbert - 04.04.2024 13:31

Hi Dani how many rows can php display?? And can you make it more than 500?

Ответить
@deepindark
@deepindark - 05.04.2024 13:38

Hi Dani - Your series about using SQL from the website is helping me a lot! However, when I follow along the video to the "Positional parameters Prepared Statement" section, I tried to type-in a new user for sign up so that it can get upload to the database. Instead of that, I keep getting this error and cannot solve it. Do you have any ideas in how to solve that?
(I do find out about something that related to 'mySQL default socket' inside the XAMPP folder but all of the fix where mainly the cause from WordPress db sever).

"Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)"

Ответить
@NkanyeziShenge
@NkanyeziShenge - 13.04.2024 00:16

You are so cool bro your lessons are so informative, great foundation

Ответить
@EL_WAFI_CHERKAOUI
@EL_WAFI_CHERKAOUI - 14.04.2024 02:04

so prepared statements enable the code to separate between data inputs and the actual sql code to prevent SQL injunction , thank you

Ответить
@MichaelHoague
@MichaelHoague - 25.04.2024 14:08

I have been a fan of your knowlege. I am dealing with a stoke so excuse me. I am running an issue when I "require_once dataObjects.php". Please Help

Ответить
@jasonramirez6182
@jasonramirez6182 - 30.04.2024 05:08

bindParam vs bindValues what are the diff of these two sir?

Ответить
@dancharlesplange-annan7227
@dancharlesplange-annan7227 - 01.05.2024 21:15

Please help me out, Hello. I have a button called register that takes care of inserting the users' input into the database. But when i clicked on the button, it showed me the code I inputted for the phpcode for the connection to my database

Ответить
@karimbedreddine8967
@karimbedreddine8967 - 24.05.2024 22:43

this was a starting point to me coding using PHP. i am not sure if you have courses on Udemy.

Ответить
@batataleal
@batataleal - 30.05.2024 08:34

Nice tutorial. I'm following all classes since the number one. This is the most confusing to me, I think it's due the concept of object in PHP not been explained yet. Even dough, great course. Hope you got your hair back at this point.

Ответить
@shakeitoff1000
@shakeitoff1000 - 07.06.2024 00:43

Dani, I've been following your videos and I love them. You present information clearly, your voice is nice to listen to and it's easy to move around/skip parts I may already know. Thank you for offering these videos for free, it means a lot.

Ответить
@editz6697
@editz6697 - 11.06.2024 15:38

get well soon dear

Ответить
@ejiedaninspirations6426
@ejiedaninspirations6426 - 17.06.2024 17:06

please I have a question. I am looking into your tutorials. talking about prepared statement, it is used so that a code will not be injected into the data base. but subsequently, when the same data is grabbed from the code and inserted in the data base, if there is a code there that can destroy the data base, wont it still work? please explain further. Thank you

Ответить
@oldumvolley
@oldumvolley - 25.06.2024 08:33

where is your hair dani wtf

Ответить
@ChaoticCabbage
@ChaoticCabbage - 25.06.2024 16:07

Anyone having issues getting this working on Mac?

Ответить
@220bytes
@220bytes - 15.07.2024 16:26

1 year down the line and we're still enjoying your videos. Thanks for the work.

Ответить
@andymalunes8316
@andymalunes8316 - 21.07.2024 00:02

finally, im here where you are bald. been waiting for this. Now look where I am at.

Ответить
@BillyRyan123
@BillyRyan123 - 26.07.2024 03:53

I tried and I keep getting error on my line 32 that undefined pdo

Ответить
@alexvallex5487
@alexvallex5487 - 07.08.2024 23:42

If I have my website done in wordpress how can i have a page that communicates with the new database?

Ответить
@philipholwerda4347
@philipholwerda4347 - 15.08.2024 00:07

Thank your Dani, your teaching is so helpful. I am having an issue with connection failed 1044 Access denied for user ''@'localhost' to database 'mydatabasename' when trying to submit my form into database. Password is correct, privileges are granted. Verrified no password is set, root, local host. Even tried giving it a password and get the same error. I can insert into database directly from phpMyAdmin but not remotely by php from form.

Ответить
@kevin-kosme
@kevin-kosme - 29.08.2024 17:02

Warning: Undefined variable $pdo in C:\xampp\htdocs\myapp\includes\formhandler.inc.php on line 13

Fatal error: Uncaught Error: Call to a member function prepare() on null in C:\xampp\htdocs\myapp\includes\formhandler.inc.php:13 Stack trace: #0 {main} thrown in C:\xampp\htdocs\myapp\includes\formhandler.inc.php on line 13

<?php

if($_SERVER['REQUEST_METHOD'] == 'POST'){
$username = $_POST['username'];
$pwd = $_POST['pwd'];
$email = $_POST['email'];

try {
require_once "dbh.inc.php";

$query = "INSERT INTO users (username, pwd, email) VALUES (?,?,?);";

$stmt = $pdo->prepare($query);
$stmt->execute([$username,$pwd,$email]);

$pdo = null;
$stmt = null;

header("location: ../index.php");
die();
} catch (PDOException $e) {
die("Query failed: " . $e->getMessage());
}
}else{
header("location: ../index.php");
}

Ответить
@michaelsunday6860
@michaelsunday6860 - 15.09.2024 19:44

You are a genius!!! Thanks much

Ответить
@NANOCEDRICLAWRENZOD
@NANOCEDRICLAWRENZOD - 24.09.2024 05:25

Thank you!

Ответить
@fifaham
@fifaham - 25.09.2024 07:17

I though who is this new guy? LOL - new hair cut.

Ответить
@sovietroll7880
@sovietroll7880 - 09.10.2024 20:40

I got an error when I click signup button "Connection failed: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO)"

Ответить
@paulhauer1598
@paulhauer1598 - 10.10.2024 13:13

Your series has been very helpful and informative. Thank you for putting it together. I have had an issue with this last video. No matter where I access the the formhandler.inc.php file whether in the includes folder or the project folder i am getting a "Forbidden You don't have permission to access this resource. Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 Server at localhost Port 80" error. Any ideas?

Ответить
@BrillaPeace
@BrillaPeace - 11.10.2024 22:07

After I submit my document I get a 404 error, my folder and website are located in the correct htdocs folder. What could be the issue?

Ответить
@ZackiSaleem
@ZackiSaleem - 17.10.2024 09:56

Is it possible that the PDO method of connection doesn't work in some operating systems?
It doesn't work for me and gives a warning in line 15 of formhandler.inc.php


Thank you, Krossing Good Luck

Ответить
@joekerr7643
@joekerr7643 - 21.10.2024 13:03

i love your videos. i suggest when you're discussing something be direct and avoid inserting things that will not be included in the topic as it makes the subject messy. if you will use a certain method, don't discuss other methods if you will not use it.

Ответить
@KelvinOmoluyi
@KelvinOmoluyi - 24.10.2024 14:07

Man, the simplicity of this video courses makes them pure joy! Thanks :)

Ответить
@Romanscii
@Romanscii - 29.10.2024 17:52

How would that work on an E-Mail form for example?

Ответить
@sylviaho9793
@sylviaho9793 - 30.10.2024 09:58

Thank you for the clear and precise step-by-step tutorial on database using php. I'm able to create and host my business database. However, i don't know how to convert the localhost llink to my company website url, do you have a video on that?

Ответить
@syedmubasharshah676
@syedmubasharshah676 - 30.10.2024 12:00

my signe up button is not working

Ответить
@samuelbaruch8790
@samuelbaruch8790 - 15.11.2024 22:33

Your hair, noo

Ответить