35: Set Data Order From MySQL Database | PHP Tutorial | Learn PHP Programming | PHP for Beginners

preview_player
Показать описание
Set Data Order From MySQL Database | PHP Tutorial | Learn PHP Programming | PHP for Beginners. Today we will learn about the 'order by' function in SQL which allow you to order the data when you fetch it from the database using the 'select' function.

INSERT INTO posts (subject, content, date) VALUES ('Subject 1','Content 1','0000-00-00 00:00:00');
INSERT INTO posts (subject, content, date) VALUES ('Subject 2','Content 2','0000-00-00 00:00:00');

➤ GET ACCESS TO MY LESSON MATERIAL HERE!

First of all, thank you for all the support you have given me!

I am really glad to have such an awesome community on my channel. It motivates me to continue creating and uploading content! So thank you!

I am now using Patreon to share improved and updated lesson material, and for a small fee you can access all the material. I have worked hard, and done my best to help you understand what I teach.

I hope you will find it helpful :)

Рекомендации по теме
Комментарии
Автор

I ran into an issue where I would get 'incorrect datetime value' if I tried using the values Daniel provided. As far as I can tell this is due to a change in the newer versions of MySQL so I improvised by changing the date and time from 0000-00-00 00:00:00 to 0001-01-01 01:00:00. I hope this helps anyone with the same problem!

vertimyst
Автор

Thank you for your videos, you are awesome, keep making more content :)

richardrichardson
Автор

Thanks for your videos. Realy learn a lot from it.

devconteh
Автор

I dont see the next login system episode. Thanks for your great explanation.

thanhvietpham
Автор

#0 dislikes
Let's maintain it people.

reassume
Автор

Hello!

I've been following just fine until your previous video, when we deleted a row of content. Now when I inserted new ones, the id starts at 2 (I guess obviously cause we deleted the 1st one). How can I make my new rows move one row up so they fill the missing id?

Thanks for taking your time in making this course, I definitely subscribed! :-)

yuyu-zsjb
Автор

why the next 4 videos are private ???

nkyikth
Автор

it scares me how lesson 44 is getting near...

maseshimlherdek
Автор

When I copied and pasted your code, it failed because invalid datetime format. I played around with it and it looks like the reason is because the month and date are both "00"? Why wouldn't it work for me but it does work for you?

SlowEasyEnglish
Автор

hi! how do i reset the primary key to 0 after deleting all the rows from a table?

joshuarifareal
Автор

Thanks for the content. But I noticed that this ordering by process just shows the rows' orders by our request rather than setting it to actual content.

eminaliyev
Автор

pls after i deleted a row and added the new ones the id starts with 2 instead of 1 like if it is still there can i reset it pls help ?

wannabehuman.production
Автор

First video mentioning a purchase.... When i did purchase, the paid material wasnt there. There was no material on patreon to assist me with this video.

SuperScallopKing
Автор

when i do this sql commands its show incorrect datetime value!!
what should i do now

mannusharma
Автор

What if you want to orderby name/subject, with characters like æøå? :) I'm guessing it will automatically change them, so æ = a, ø = o, å = a, or something like that?

TobiasMMadsen
Автор

when you delete rows then add new ones the ID still auto increments from the values you have deleted instead of restarting from 1 how do you fix this?

DemonKing-myhx
Автор

When I added these entries, it automatically updates the id's to 2 and 3...so i deleted them again and added these again... the id was then changed to 4 and 5. How do i stop this?

padamchopra
Автор

most of youtubers got inspired by mmtuts for sure.

gabrielfono
Автор

in part 34 you delete id='1' and i cant again insert data in id ='1'

mohammadeshaghi
Автор

its written php tutorial and you talk about mysql .they are 2 different things.

omer-bs