How does one add select data to a field (from mysql ) and have this duplicated when the rows are added. THis is a great tutorial... but where does one get the source code.
Hi great tutorial, I had one quick question, how do you set it up so that on post back make sure the values are retained because if not someone hit submit but missing something and on postback if this field refreshes dont want to have to type it all again. Similarly if I am editing this for how do I retrieve these values from the database and display such the functionalit stays the same
@@phpBasics yes, but how do you this for the dynamically generated fields, like the ones you have on the video, upon submission, if there is an error on the form don't want the dynamically generated fields to reset
Hey Shawn, I am a big fan of your tutorials. I should start off by stating that I am new to programming. Here is what I am trying to do and I am struggling: Right about at your 10 minute mark in this video. Ok. I am trying to enter data from an array, with an SQL query, using PDO, using a prepared statement, using :placeholders. I can execute the prepared statement no problem. Following your tutorials, I can add additional rows to my form, remove excess rows, submit the data, then, enter the data from multiple rows into the database. However, I am having trouble figuring out how to sanitize/filter the data before it is inserted into the database. Usually, when I enter data from a form I use this line of code because the information is not from an array: $company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_FULL_SPECIAL_CHARS); Do you know of a way to sanitize/filter the data using a prepared statement with placeholders? Or, should I abandon the prepared statement/:placeholder method in favor of the method you describe in this tutorial? I hope this makes sense. Thanks in advance. Jim Update: I found a way to make this work. Right after you check if the form has been submitted (Line 5 ), enter the "filter_input_array" function like this: $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
Good evening, I have a small inconvenience, because I have the code to generate dynamic fields, but then when saving the data in the database it does not save all of them, that is, I create 3 columns of 4 rows each and only save the last four rows.
Great tutorial! Ironically, I am trying to do the opposite of this. I have an HTML element that is dynamically populated from a MySQL database. The table contains the serial numbers of car seats available for rent. Sometimes, people rent multiple car seats and therefore, I would need to "add" as many car seats to their order form as necessary. Would I use the same process for select elements that are dynamically populated as you did?
Awesome tutorial, it helped me a lot. Also please can you help me, how can I add a select dropdown with data from database. Or do you have any video tutorial of that... Thanks a lot once again...
Thanks a lot for the video sir.. It greatly helped me.. Can you please assist me in the following scenario?? So, along with the fields that you have taken, I have included order Id also in the form... and to that order Id.. I have given the auto numbering code... So.. for the parent field.. the automatic number system is working as expected. However, for the child field.. i.e., for the fields with the Add more link are not getting automatic numbers.. How can we resolve this.. please explain..
Have you thought about doing a web series on creating a modern website from scratch? It would be interesting to see the process from your point of view and to see what route you take. Good video btw.
Is there a particular style of website you're interested in seeing? I could definitely put something like that together, but I'm not much of a front end designer.
A good example could be a website where users can review products. Each user would have their own accounts and ability to interact with each other maybe. There could also be a search functionality within the website.
Sir, I have two tables. (Users) (Posts) and I linked it to something called (Foreign Key) but I want to display one user's posts among other users' posts. I'm always looking for this thread, but I can't find who explains it and fetches single user posts, if you know this please explain it in a video in php - pdo
Excellent video. can you post code using PDO for inserting multiple rows of data into sql table? the php version you have used is older and I am unable to make it work.
Great instructional video. Although I populate more than one row of data within the form. When I retrieve it to update my database only the first row of the array contains data. What am I doing wrong.
If I am trying to send the contents of these dynamic variables in an email using php. How do I address these variables in my external php file? $make=$_POST['make']; ---- What would be the variable for the next make?
if i add 1 row, it works and make, model and serial values are written in db, but if i add multiple rows it does not work. i'm not getting an error but mutliple values are not written into db. anybody has any clue? (code is exact copy of code from video)
Undefined offset typically revolves around the array key. It means you're referencing a key that's not valid. Make sure you're starting at 0 and not 1. If you have any other issues, send me a message on Skype. CoolEditz
1) i mean fetching data from data base and edit the inputs and again update the input fields and insert new inputs with updated inputs . 2) can i write insert and update queries at a time ??
Thank you very much. You are a great teacher. great teaching. A Brazilian subscribed to your channel
You have given me a rare opportunity to learn without much stress. So oo simple and on point explanation. Thank you for this....
Thank you very much. If you need any assistance, let me know. My Skype is CoolEditz
great for learning tnq alot
How does one add select data to a field (from mysql ) and have this duplicated when the rows are added. THis is a great tutorial... but where does one get the source code.
Hi great tutorial, I had one quick question, how do you set it up so that on post back make sure the values are retained because if not someone hit submit but missing something and on postback if this field refreshes dont want to have to type it all again.
Similarly if I am editing this for how do I retrieve these values from the database and display such the functionalit stays the same
Something like this -
@@phpBasics yes, but how do you this for the dynamically generated fields, like the ones you have on the video, upon submission, if there is an error on the form don't want the dynamically generated fields to reset
thumbs up bro!!! you really are a great teacher.
Hey Shawn, I am a big fan of your tutorials. I should start off by stating that I am new to programming. Here is what I am trying to do and I am struggling: Right about at your 10 minute mark in this video.
Ok. I am trying to enter data from an array, with an SQL query, using PDO, using a prepared statement, using :placeholders. I can execute the prepared statement no problem. Following your tutorials, I can add additional rows to my form, remove excess rows, submit the data, then, enter the data from multiple rows into the database. However, I am having trouble figuring out how to sanitize/filter the data before it is inserted into the database.
Usually, when I enter data from a form I use this line of code because the information is not from an array: $company = filter_input(INPUT_POST, 'company', FILTER_SANITIZE_FULL_SPECIAL_CHARS);
Do you know of a way to sanitize/filter the data using a prepared statement with placeholders? Or, should I abandon the prepared statement/:placeholder method in favor of the method you describe in this tutorial?
I hope this makes sense. Thanks in advance. Jim
Update: I found a way to make this work. Right after you check if the form has been submitted (Line 5 ), enter the "filter_input_array" function like this:
$_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);
Good evening, I have a small inconvenience, because I have the code to generate dynamic fields, but then when saving the data in the database it does not save all of them, that is, I create 3 columns of 4 rows each and only save the last four rows.
Hey you should update more! You have a great teaching style
I appreciate the feedback. I have new content coming soon :)
Hi sir this video is more using for me i have an doubt how i insert primary key and foreign key in that table like to reference another table
you just saved my life, thanks
How Can I add Dropdown lint in dynamic fields? Please must reply.
Good job dude!!! Is it possible use same logic in order to insert multiple record into different tables with foreign key?
So awesome thank you! God bless
Hello sir,
I have a data working with rows counting. I want to it counted when inserting and deleted record seperately.
Thanks for th tutorial. But on my web page , checkbox doesn't work properly in the var html. Can you help me?
Really thanks
Great tutorial! Ironically, I am trying to do the opposite of this. I have an HTML element that is dynamically populated from a MySQL database. The table contains the serial numbers of car seats available for rent. Sometimes, people rent multiple car seats and therefore, I would need to "add" as many car seats to their order form as necessary. Would I use the same process for select elements that are dynamically populated as you did?
I would populate the first select tag and then copy it the way I did. That way you don't have to keep querying the database
phpBasics after I've populated it from the database, I would in essence follow the video, making minor adjustments where necessary?
Yes. You can skype me if you run into problems. CoolEditz
Awesome tutorial, it helped me a lot. Also please can you help me, how can I add a select dropdown with data from database. Or do you have any video tutorial of that... Thanks a lot once again...
I will do that.
Thanks a lot for the video sir.. It greatly helped me.. Can you please assist me in the following scenario?? So, along with the fields that you have taken, I have included order Id also in the form... and to that order Id.. I have given the auto numbering code... So.. for the parent field.. the automatic number system is working as expected. However, for the child field.. i.e., for the fields with the Add more link are not getting automatic numbers.. How can we resolve this.. please explain..
Have you thought about doing a web series on creating a modern website from scratch? It would be interesting to see the process from your point of view and to see what route you take. Good video btw.
Is there a particular style of website you're interested in seeing? I could definitely put something like that together, but I'm not much of a front end designer.
A good example could be a website where users can review products. Each user would have their own accounts and ability to interact with each other maybe. There could also be a search functionality within the website.
Is there a way to insert all fields under 1 ID in the database?
Sir, I have two tables. (Users) (Posts) and I linked it to something called (Foreign Key) but I want to display one user's posts among other users' posts. I'm always looking for this thread, but I can't find who explains it and fetches single user posts, if you know this please explain it in a video in php - pdo
You can Skype me if you'd like: COOLEDITZ
@@phpBasics I don't have an account but I will create
Excellent video. can you post code using PDO for inserting multiple rows of data into sql table? the php version you have used is older and I am unable to make it work.
Great man ..Thanks!!
Great instructional video. Although I populate more than one row of data within the form. When I retrieve it to update my database only the first row of the array contains data. What am I doing wrong.
nevermind figured it out.
mine only adds the first row to db..can anyone please tell me why its happening? followed the tutorial step by step
Hi, Jane. If you'd like to send me your source code, my Skype is CoolEditz
If I am trying to send the contents of these dynamic variables in an email using php. How do I address these variables in my external php file?
$make=$_POST['make']; ---- What would be the variable for the next make?
Check out the foreach function in PHP.
Thank You for taking out time to respond, I would try that now!
how to make one of the fields have a drop down box with options as values from a mysql database
I have a video on that.
i found it, but that shows a static drop down box . I wanted to make one of the fields shown in the above video itself as a drop down box.
how do you remove them from the data base, cause you added to it, how do u remove it
Hi can you help how to create a form from the excel upload with the db data!
I believe so. Feel free to reach out on Skype: CoolEditz
if i add 1 row, it works and make, model and serial values are written in db, but if i add multiple rows it does not work. i'm not getting an error but mutliple values are not written into db. anybody has any clue? (code is exact copy of code from video)
found it, fixed it :-)
I am having the same problem. How did you fix It?
@@VeljkoBijelivuk what was your solution? I am only able to populate the first row of the array within the form. What am I doing wrong?
how to same value add sql table. plz explain
Currently getting this error, and the last field to be sent doesn't appear in the database
Undefined offset: 1
Undefined offset typically revolves around the array key. It means you're referencing a key that's not valid. Make sure you're starting at 0 and not 1. If you have any other issues, send me a message on Skype. CoolEditz
please upload the same tutorial but with the radio input.
How can convert these data in to json
How to prevent duplicate entry?
Do a query against the database for that serial number before the insert. If number of rows returned is NOT 0, then that item already exists.
can anyone help me with the num_rows key word
can you please describe how to retrive data in same fields
I don't understand what you mean.
1) i mean fetching data from data base and edit the inputs and again update the input fields
and insert new inputs with updated inputs .
2) can i write insert and update queries at a time ??
real_escape_string not working T.T HELP!!
If you're incorporating this into your own code, make sure you're using NEW MySQLi to connect to your database or it won't work.
how to do this in java netbeans
hi sir
can u show us how to upload & save an image into database using this concept
How to use this code using codeigniter