update & delete multiple records PHP mysql tutorial [ENG]

preview_player
Показать описание
Hello there.
I made a newer version about this topic:
Please watch it, and leave a comment if you got questions.

update & delete multiple records PHP mysql tutorial [ENG]
Рекомендации по теме
Комментарии
Автор

Thanks bro. I've had a problem with my multiple update in my sql via php form. You've helped me a lot. I've solved that problem. Thanks.

ytytt
Автор

thank you thank you thank you! I have learned SO much with your tutorial!

PeterReginald
Автор

thanks thanks thanks...very good tutorial :-)

luxena
Автор

Thank you so much for this video. Though it might be old, but trust me, it was super useful to me. God bless you!

sureboi
Автор

thank you so much for this, it works great and helped me a lot . I have a date field which can be null. When I update records if there is nothing entered in the form it doesn't leave the field null, it enters a date of 0000-00-00.
Here's the code (minimal modifications from what you use. COMPLETED is the date field):
while ($row=mysql_fetch_assoc($res) )
{
echo 'LIST_NUM : ' . $row["LIST_NUM"]. '<br/>';
echo 'Item name: ' . $row["ITEM_NAME"]. '<br/>';
echo 'Completed on : <input type="text" name="COMPLETED['. $row["LIST_NUM"] .']"
echo '<input type="hidden" name="LIST_NUM[]" value="'. $row["LIST_NUM"] .'">'."\n";
echo '<input type="checkbox" name="delete[]" value="'. $row["LIST_NUM"] .'">'."\n";
echo "<hr>\n";

corneliusconboy
Автор

Thank youuu friend it's very helpful :)

AyoubLahraoui
Автор

Increíble como me ayudaste, excelente video, muchas gracias +10

eduardosanchez-ipzt
Автор

thank you mate! it helped me a lot. :3 :D

OMKARHATANKAR
Автор

Yes, it is possible, today i'll upload the source code as downloadable source.

djjjozsi
Автор

Great job, it works a treat. Can you do a tutorial on individual updates. Rather than updating the whole table each time, you could update individual records. An individual update button per record, hope that makes sense. Thanks again Dec

decconb
Автор

Hi
Thanks for the tutorial It is very helpful
I want the code If it is possible to have it

sherisuly
Автор

Man... Oh... God... You're like god... Really, I'm from Mexico and... I'd been looking for a update multiple 'cause I'm working on a dynamic form... There's no useful information in spanish about this, I could kiss you... Really... Ah... I will make a tutorial to explain this in spanish and I'll mention your video... Thank you so much!

Saludos y mucha suerte, eres genial!

lovelyhye
Автор

Hi Thank you for this tutorial! im a little bit stuck! i have got to the bit where you can update and see it changing however this does not work for me! i double checked the code and nothing seems to update! do u have the files for this tutorial?

mineshmandalia
Автор

okay, i'll make a tutorial about the mentioned issue, .

djjjozsi
Автор

Dear, djjjozsi, thank you for a great turoial. I haven't seen a video that addresses how to update/delete multiple records in a form. You should make another one with a little clearer screen, as it looks blurry on my end. Also, an intro on how arrays work to implement these methods would be great.

I tried to implement your tutorial on my scripts. The update worked well, but the delete does not work. I wonder if it's because my primary key in the table is a text field. Any thoughts?

TheDD
Автор

i've updated the video description, you can download from there.

djjjozsi
Автор

Thank you so much Jozsi, I am working on School Project, I have issue on how to select course_ID from Course Table and see Students in that specific Course on the form.
Now I will explain more about what I am trying to do:

1: I created Tables : Student table, Courses Table, Attendance Table:
I joined tables using Student ID and Course ID in attendance table as FK keys.

Now I need to select students by coureid, I can easily select the student by using sql query like (" Select * from attendance where course_ID=''anycoursename");

In this case, I will see only students who are taking that specific course...
but I want to create dropbox and select the course_ID from the dropbox and after I select the course_ID from dropobx, I want to click on submit button and then see students who currently enrolled that course.

I can create dropbox in php like:

$sql = "SELECT courseid FROM Courses";
$rs = mysql_query($sql) or die(mysql_error());
echo "<select>";
while($row = mysql_fetch_array($rs)){
echo "<option
}mysql_free_result($rs);
echo "</select>";


now I can see all course_IDs
but the I want but I want select the course_ID and than pull the students from the table... Please help....

if anyone can help, Please create small tables
like student_table ID, Name.
course_table ID, cours_ID
attendance_table ID, name, course_ID
do not worry about joining .... just show me how to select value from drop box and populate data on the form which ...


fngwalkers
Автор

thanks much, but do you how to let user change images in local folder using php..thanks in advance

meilinglim
Автор

can you share your source code ? great tutorial

michaelbengabriel
Автор

at mysql_connect i had a little confusing, i don't really often write it :)

djjjozsi