PHP - Update Records In MYSQL Database Using PHP

  Рет қаралды 153,581

The Programming Geek

The Programming Geek

Күн бұрын

Update Records In MYSQL Database Using PHP
In this tutorial I created one index.php to display all the records.
For each record i have created different form. Each form has one hidden field for primary key, Iave also added Update button to each form when we click on the update button of particular records the ID and new values of that records is send to the update.php page via POST method. Second Page I created update.php,this page contains php script to update the records in mysql.
This video is for learning PHP and develop websites using PHP and MYSQL. The aim is to teach the Web Designing/Development in a step-by-step guided approach.
Intro Track By : Danish Shaikh
~-~~-~~~-~~-~
Please watch: "Registration Form In PHP adn MYSQL"
• Registration Form In P...
~-~~-~~~-~~-~

Пікірлер: 142
@suryadi_office
@suryadi_office 2 жыл бұрын
great friend, success always
@yossihorev3250
@yossihorev3250 6 жыл бұрын
Thank you so much ! I needed this tutorial desperately !
@GenghisD0ng
@GenghisD0ng 6 жыл бұрын
Thank you! I had to search so long for this
@sahanaakter2811
@sahanaakter2811 7 жыл бұрын
Thanks for nice tutorial for us .I want to say Really nice tutorial .I have got it Today.Now I am felling so well.That's why i am commenting This site.Due to It helped a lot of.At last I Will wait next tutorial
@KusakaStudio
@KusakaStudio 4 жыл бұрын
Thanks for your tutorial, it was really helpful for me :).
@DIAP2001
@DIAP2001 7 жыл бұрын
Excellent explanation. Short and clear. I was very useful for my. Thank you!
@cerealkiller1889
@cerealkiller1889 6 жыл бұрын
Excellent Tutorial. Keep it up! More php tutorials coming.
@globalentertainment3169
@globalentertainment3169 7 жыл бұрын
Done perfectly, thank you
@mraziz3230
@mraziz3230 4 жыл бұрын
Thank you, i learnd how to make edit and delete by your videos. Thank you so much. :)
@patrickbroaden9820
@patrickbroaden9820 3 жыл бұрын
Great video...💪🏾
@akshaykhairnar1747
@akshaykhairnar1747 6 жыл бұрын
you are great bro.... thank u so much........
@mariadebbah1759
@mariadebbah1759 6 жыл бұрын
Thankyou sooooo much you have helped me a lot , BARAKA ALLAHO FIKA
@khalidQweder
@khalidQweder 7 жыл бұрын
Good Tutorial, Thank you.
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+khalid Qweder You are welcome brother!
@paragkulkarni9770
@paragkulkarni9770 6 жыл бұрын
Very helpful video. Thanks a lot.
@computerlearning2322
@computerlearning2322 3 жыл бұрын
Excellent explanation. Short and clear. I was very useful for my. i very use this video and one agen Thank you! and sir please share link in delete in database video?
@shreyas_katagi
@shreyas_katagi 5 жыл бұрын
Good job.👌 Next time attach the files in the description so that it can be downloaded.
@tido7977
@tido7977 5 жыл бұрын
job well done
@ritulkumar1211
@ritulkumar1211 5 жыл бұрын
Thank you, It was very simple and helpful!
@HassanAli-xd7jg
@HassanAli-xd7jg 5 жыл бұрын
Your are the best
@mrrono1842
@mrrono1842 5 жыл бұрын
Lot of thanks bro.
@inspirationalquotes9469
@inspirationalquotes9469 4 жыл бұрын
Thank you so much ! I was desperately searching an option for this. My table has lots of records in it. I want it to set the height of the table and use a scroll bar to move up or down. please help.
@acetech529
@acetech529 6 жыл бұрын
Thank you very much Boss,
@LGOKUL2303
@LGOKUL2303 4 жыл бұрын
THANK YOU SOOO MUCH!
@boniphaceudoya8936
@boniphaceudoya8936 7 жыл бұрын
Great video thanks I was totally nothing.
@charmelainejonathan8540
@charmelainejonathan8540 8 жыл бұрын
Awesome video... Keep up the great work!!!!
@7footballvideos220
@7footballvideos220 7 жыл бұрын
You re KING!
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+7 football videos Thank You ☺
@yguzman77
@yguzman77 7 жыл бұрын
7 football video s
@deepukoyickal9186
@deepukoyickal9186 5 жыл бұрын
Thanks bro
@idriskoli1380
@idriskoli1380 7 жыл бұрын
good
@movax6994
@movax6994 5 жыл бұрын
Thank you!
@acetech529
@acetech529 6 жыл бұрын
Great video
@TheProgrammingGeek
@TheProgrammingGeek 6 жыл бұрын
Thanks
@yatheeshkrishna376
@yatheeshkrishna376 6 жыл бұрын
Executed without error thank u:)
@mucachobench2628
@mucachobench2628 5 жыл бұрын
i love you, thanks, this mean a lot for me
@ane-manda
@ane-manda 4 жыл бұрын
thank you
@cedric1015006
@cedric1015006 6 жыл бұрын
Awesome bro
@TheProgrammingGeek
@TheProgrammingGeek 6 жыл бұрын
Thanks,
@ElegantCoder
@ElegantCoder 7 жыл бұрын
Really good nice job bro....
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Ali Mohd mughal Thank You Brother !
@ElegantCoder
@ElegantCoder 7 жыл бұрын
welcome Brother
@eastern815
@eastern815 6 жыл бұрын
thanks man
@aurelfrancis
@aurelfrancis 5 жыл бұрын
hi i am getting this error Parse error: syntax error, unexpected 'update' (T_STRING), expecting ',' or ';' in C:\xampp\htdocs\edit.php on line 44 please help
@wasifzahed
@wasifzahed 7 жыл бұрын
thanks a lot :)
@preetigupta3834
@preetigupta3834 7 жыл бұрын
Video is very nice sir but video is little bit blur. Plz check this part
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Preeti Gupta Sure I will upload future videos in good quality.
@tundeo2622
@tundeo2622 5 жыл бұрын
Nice one! However, The execute query for the update.php worked without the curly braces in the if statement.... Interesting
@alsahiq.n.4989
@alsahiq.n.4989 4 жыл бұрын
Thanx, can u explain how to update but one submit
@pravinctiwari7160
@pravinctiwari7160 7 жыл бұрын
Thanks! For Tutorial. I am new on the php and mysql. Just i want to know, if i want to show and update the image then what i need to do?
@tejaswiniwalde8257
@tejaswiniwalde8257 5 жыл бұрын
sir, these code shows the error i.e. Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';' in E:\xampp\htdocs\mycode\index.php on line 20
@kavyakkamath9985
@kavyakkamath9985 4 жыл бұрын
How did u resolve this?
@jackngo9338
@jackngo9338 3 жыл бұрын
What about having just on single update or submit button?
@ericfianu6090
@ericfianu6090 8 жыл бұрын
Great video. Helped me a lot. But one thing I want to ask is how can I update only one row or item instead of displaying all bcos if I have a long list it will be inneficient to load all datas. I just need to update one data at a gym. Can u pls pls make a video for that?
@TheProgrammingGeek
@TheProgrammingGeek 8 жыл бұрын
+Eric Fianu I will Make the video for Update only one record.
@ericfianu6090
@ericfianu6090 8 жыл бұрын
Will be checking on it. But thanks so much
@teenmastr
@teenmastr 7 жыл бұрын
any link to that video??
@martinmtandi335
@martinmtandi335 6 жыл бұрын
need that code too, asap. kindly help please. u can email me the code at mtandimartin@gmail.com
@SanjeevBeekeeper
@SanjeevBeekeeper 6 жыл бұрын
I know its late but if anyone come across your question, this will help. In the page where you want to show one record, just add the WHERE tag - $sql = "SELECT * FROM your_table_name WHERE ID='$_GET[id]'";
@vascofx3475
@vascofx3475 4 жыл бұрын
I follow step by step , but still not updated :(
@Faradars1
@Faradars1 8 жыл бұрын
Hi how can i add +1 to the value in my data base? for example in salary you have 8000 when i clik the button add +1 to the value to get 8001
@ib165
@ib165 6 жыл бұрын
Good Tutorial. But i want to ask what if we want to save the data to another table
@roshnimeravi9163
@roshnimeravi9163 4 жыл бұрын
thanks for your tutorial, but unable to update the database, pls help
@wisdomguy9837
@wisdomguy9837 Жыл бұрын
How about if a want to update all records at the same time? If I want it to update all salary of all records with one one click or button? Batch update
@sunaish
@sunaish 8 жыл бұрын
Hi I am creating tabular form where user will land on the form after accessing the provided unique link, there on the form he should enter or update the data when he will click on save tab button which will be provided on every tab. Can you please help me with this?, I got success for fetch the data from form and insert into the database but when update form doesn't work.
@TheProgrammingGeek
@TheProgrammingGeek 8 жыл бұрын
+sandesh nirulkar Hi Sandesh , I will be happy to help you. Can you please provide the complete code , I will try to solve the problem.
@sunaish
@sunaish 8 жыл бұрын
Here is the code: Please help me with this
@maxcohen13
@maxcohen13 8 жыл бұрын
Nice video! What is needed for a confirmation message after an entry has been successfully changed? I tried using *echo* "Success!"; but I got an error.
@TheProgrammingGeek
@TheProgrammingGeek 8 жыл бұрын
Can you please give code in which you are getting error. Post that code in this comment or Fell free to contact on mohd.asim4sk@gmail.com
@maxcohen13
@maxcohen13 8 жыл бұрын
+The Programming Geek I guess I do not know where to put a confirmation message. I thought of this (in the update.php): if (mysqli_query($con,$sql)) header ("refresh:1; url=index.php; echo 'Success';"); This did not work. Perhaps the echo statement would go in brackets? I'm not sure.
@TheProgrammingGeek
@TheProgrammingGeek 8 жыл бұрын
+maxcohen13 Try This one:- if(mysqli_query($con,$sql)) { echo"Success"; header("refresh:1; url=index.php"); }
@maxcohen13
@maxcohen13 8 жыл бұрын
Ah, brackets. I will try. Thank you!
@TheProgrammingGeek
@TheProgrammingGeek 8 жыл бұрын
+maxcohen13 Does that code solved your problem. Put echo tag before the header function if you put echo after header the page will be redirected before showing success. And also don't use echo inside header.
@milesjoshualubay3328
@milesjoshualubay3328 3 жыл бұрын
I already copy your codes to update my database but my database is not updating
@LetsRepaintIt
@LetsRepaintIt 7 жыл бұрын
Hi, I'd like to ask you to make a video. I made a database with all 3 different columns in it and about 600 rows. I made a query to filter the rows. I want the first column and second column to be read only and in the third column there should appear a checkbox. The query shows ~30 rows each time, I want to be able to tick all third columns from each row and then update them all at once with one button. If you got time, please tell me how by making a video. Thanks in advance!
@eeoonn_
@eeoonn_ 7 жыл бұрын
I have an error with the update syntax. It says "Notice: Array to string conversion in C:\xampp\htdocs\studfolio\update_prof.php on line 7" Here's the code: $sql = "UPDATE users SET fname='$_POST[fname]', mname='$_POST[mname]', lname='$_POST'[lname] where empID = '$_POST[empID]'";
@ISOnepal
@ISOnepal 4 жыл бұрын
Can we update mutiple rows in single submit button rather than updating one by one ?
@lledos6639
@lledos6639 7 жыл бұрын
How would you use just one button to update them all rather than having to click a separate button for each row?
@rw7799
@rw7799 6 жыл бұрын
how do you update a form but if user leaves say a password field blank it doesnt update the db with a blank value and leaves the value alone in the database. i.e a password that isnt displayed to user for security reasons but they can update the password.
@hanselbugwat7817
@hanselbugwat7817 6 жыл бұрын
Hello, i am having a problem with my update, it says successfully update but no update happening in the database, please help!
@TheProgrammingGeek
@TheProgrammingGeek 6 жыл бұрын
Can You Please Share your code ? , I happy to help you , Asim From The Programming Geek
@hanselbugwat7817
@hanselbugwat7817 6 жыл бұрын
should i post it here Aslim?
@TheProgrammingGeek
@TheProgrammingGeek 6 жыл бұрын
Yes, You can post it here. Or you can email me at mohd.asim4sk@gmail.com Thanks, Asim From The Programming Geek
@roshnimeravi9163
@roshnimeravi9163 4 жыл бұрын
@@TheProgrammingGeek i also tried this nd i m also facing the same problem pls tell how to resolve it
@sarag7218
@sarag7218 6 жыл бұрын
Sorry, I don't speak english very well. I have a question, when i press the button, the input type don't update. I don't know why, it dosent' say error but it don't update
@spiritfinger1477
@spiritfinger1477 2 жыл бұрын
Sir if I want to update file photo, how to update? because in update.php I adding before update like this $photo_tmp = $_FILES[photo][tmp_name]; $photo = $_FILES[photo][name]; $sql = "UPDATE data_users SET photo = $photo , alumni= '$_POST[alumni]' WHERE username= '$_POST[id]'"; getting error
@kashishbehl1617
@kashishbehl1617 7 жыл бұрын
What if we have to update data of only one user how will we do that because in this code all the users are displayed at the same time.
@asimtoppo5170
@asimtoppo5170 7 жыл бұрын
can u make loan update video as you make it
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Asim toppo I am happy to help you, Can you please describe which tutorial you want ? I will make it for you.
@visha8621
@visha8621 7 жыл бұрын
Hii, I need a complete form with checkboxes, textfield etc, when submitted from front end, it should go to backend, where the admin is able to edit, archive and search for the form. The submitted form should be in table. My project is about a form. If information is submitted correctly, it should go to archive.. plzzzz help, if u have any references :( if possible make the video soon before 13 March. Thanks
@punkybirdster4651
@punkybirdster4651 6 жыл бұрын
i cant update a DATE column. it throws an index error message
@aishastips871
@aishastips871 7 жыл бұрын
error shown in update query Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING)
@gpravn
@gpravn 7 жыл бұрын
sir my version 5.5.38 which is supported mysql or mysqli.can u tell me please
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+pravn gundeti PHP 5.5.38 supports MySQLi From PHP 5.5 MySQL is Deprecated, you have to use MySQLi or you can use PDO_MySQL.
@Saezvg
@Saezvg 6 жыл бұрын
Parse error: syntax error, unexpected 'header' (T_STRING) in C:\xampp\htdocs\popv2\scripts\update.php help
@someshsahu236
@someshsahu236 6 жыл бұрын
hi can you please help me in creating registration system that automatically generates id ??
@othabesttvdjcoleman218
@othabesttvdjcoleman218 4 жыл бұрын
Thamkyou but how can you find the total salary and install in the data base
@pranalibejelwar9667
@pranalibejelwar9667 5 жыл бұрын
hi ,if i want to send one person's salary to other then how to do that ?
@syamilfuad5098
@syamilfuad5098 7 жыл бұрын
i have a problem. it keeps saying UNDEFINED INDEX at the update.php How do i fix this?
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Syamil Fuad Hi Syamil Fuad Can you please provide your PHP Code.
@syamilfuad5098
@syamilfuad5098 7 жыл бұрын
+The Programming Geek yes do i provide it here?
@syamilfuad5098
@syamilfuad5098 7 жыл бұрын
The Programming Geek i have two fies .php 1st one is for the index purpose, i named it admin_registrar_pending.php. 2nd is admin_registar_update.php which is the problem file
@syamilfuad5098
@syamilfuad5098 7 жыл бұрын
1st file codes: admin registrar student .active { background-color: #4CAF50; } Profile Guideline Apply Official receipt EPF withdrawal letter Confirmation letter Status Logout PENDING STATUS LIST
@syamilfuad5098
@syamilfuad5098 7 жыл бұрын
2nd file codes:
@arlanariola9502
@arlanariola9502 6 жыл бұрын
can it be use on php version 5?
@tanishaagnihotri4954
@tanishaagnihotri4954 4 жыл бұрын
Sir mere program me error nhii aa rahi h but update bhi nhii ho raha h plzz help me
@ryklin1
@ryklin1 5 жыл бұрын
How come you don't call mysql_close() ?
@OneAnOnlyRishi
@OneAnOnlyRishi 7 жыл бұрын
Im getting an error with my update query. $sql = "UPDATE library SET ISBN='$_POST[ISBN]', Author='$_POST[Author]',Title='$_POST[Title]',Year='$_POST[Year]', WHERE Book_id='$_POST[id] ' ";
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Guru101 What error is shown , please paste that error.
@chamberecho3552
@chamberecho3552 7 жыл бұрын
yeah dude! 4 out 5 tutorials end up in an error. this is seen as easy and in a pain in the ass
@fitzgay4647
@fitzgay4647 7 жыл бұрын
remove the colon( , ) after [ Year]'
@nagasupreeth2400
@nagasupreeth2400 6 жыл бұрын
Tysm sir please send me the code please
@imranthaim9203
@imranthaim9203 7 жыл бұрын
database ko select kese karte hai
@csandreas1
@csandreas1 6 жыл бұрын
Welcome to spaghetti code
@MuhammadAli-zg2nw
@MuhammadAli-zg2nw 4 жыл бұрын
for form of type='submit', you dont have name. Dont know how is it working for u
@haarishk2302
@haarishk2302 7 жыл бұрын
how to reduce the value by updating
@bde5692
@bde5692 5 жыл бұрын
Do you have a link to the code?
@jenifayasmin9124
@jenifayasmin9124 7 жыл бұрын
Name Age Salary show the out put in browser
@SureshKumar-qx6vh
@SureshKumar-qx6vh 3 жыл бұрын
Pls tutorial in hindi
@priyankabhagat4335
@priyankabhagat4335 5 жыл бұрын
sir code error dera echo (T_ECho)
@liyah33
@liyah33 7 жыл бұрын
does anyone have source code for this?
@maryomam920
@maryomam920 Жыл бұрын
can anyone send the code? I have an assignment in less than hour :(
@liyah33
@liyah33 7 жыл бұрын
help me????
@the3gamingstars837
@the3gamingstars837 7 жыл бұрын
source code?
@imranthaim9203
@imranthaim9203 7 жыл бұрын
sir aapka whatsapp no. kiya hai
@Sachinsharma-zl2kh
@Sachinsharma-zl2kh 5 жыл бұрын
thoda aache se Btao bhai
@dedsecy
@dedsecy 4 жыл бұрын
Dislike for no source code
@alllateststatusvideo218
@alllateststatusvideo218 6 жыл бұрын
bhai kyu farji video dal kr logo ko bewkuf ban rha hai aur IT walo ka insult kra raha hai bhai
@globalentertainment3169
@globalentertainment3169 7 жыл бұрын
Done perfectly, thank you
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Venkey Dematti You are welcome !!!
@TheProgrammingGeek
@TheProgrammingGeek 7 жыл бұрын
+Venkey Dematti You are welcome !!!
@inushansari5655
@inushansari5655 6 жыл бұрын
Thank You
@hiaQadeer
@hiaQadeer 7 жыл бұрын
Thank you ~
PHP - Delete Records From MYSQL Database Using PHP
15:36
The Programming Geek
Рет қаралды 61 М.
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 125 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 32 МЛН
Как подписать? 😂 #shorts
00:10
Денис Кукояка
Рет қаралды 6 МЛН
UPDATE / EDIT Records In Database Table: PHP & MySQL
10:05
Technotip
Рет қаралды 292 М.
How to update/edit data into database using PHP MySql
19:17
Funda Of Web IT
Рет қаралды 126 М.
How to connect HTML form to MySQL Database with PHP.
26:30
Step by Step
Рет қаралды 108 М.
How to make Login Form using PHP MySQL | Xampp
36:28
Tech Coffee Break
Рет қаралды 259 М.
Learn SQL In 60 Minutes
56:24
Web Dev Simplified
Рет қаралды 2,1 МЛН
how to search data from database in textbox using PHP MySql
15:32
Funda Of Web IT
Рет қаралды 79 М.
you need to learn SQL RIGHT NOW!! (SQL Tutorial for Beginners)
24:25
NetworkChuck
Рет қаралды 1,5 МЛН
How to Update Record in PHP? | PHP MySQL Update Data
13:06
Code With Yousaf
Рет қаралды 1,9 М.
这三姐弟太会藏了!#小丑#天使#路飞#家庭#搞笑
00:24
家庭搞笑日记
Рет қаралды 125 МЛН