PHP Tutorial (& MySQL) #31 - Getting a Single Record

PHP Tutorial (& MySQL) #31 - Getting a Single Record

Net Ninja

5 лет назад

73,745 Просмотров

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


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

Alfie Collins
Alfie Collins - 25.04.2023 19:13

Can someone please explain to me why when you're making requests to and from the database, the queries always start with `mysqli` rather than just `mysql`. What does the `i` stand for?

Ответить
송예은
송예은 - 09.06.2022 06:32

Your tutorials are the best! Really appreciate your videos=)

Ответить
João Verde
João Verde - 08.06.2022 11:50

You are the best teacher. Im recomending you to all my friends who are starting at computer engeneering and other to learn more and more. Continue the good work. Once i have a job i will gladly donate you because you are helping everyone so much in a way that anyone can learn. Again, thanks a lot.

Ответить
Joel Otero
Joel Otero - 30.03.2022 20:50

i keep getting an error saying: Warning: Undefined variable $product. I have changed $pizza to $product in the variables up top, but it gives me the error that the variable is not defined. any ideas?

Ответить
Josip Hrkać
Josip Hrkać - 23.03.2022 20:54

Can I use $_POST instead of $_GET, when checking is variable set?

Ответить
Jericho Santonia
Jericho Santonia - 07.02.2022 08:22

THAK U SO MUCH

Ответить
Isuri Pabasara
Isuri Pabasara - 06.10.2021 09:10

It's working thank you

Ответить
Mahlatse Masakagobe
Mahlatse Masakagobe - 17.09.2021 17:22

I love Ninja!!! Love you ma man!

Ответить
Nejan Senarathne
Nejan Senarathne - 10.09.2021 09:19

You are the best
😭😭😍
Thx a lot 🥺👌❤️

Ответить
Anupam Yadav
Anupam Yadav - 19.07.2021 22:14

Thanks a lot!!! It really helped me. But I am get getting $id not defined or Warning: Undefined variable $id in C:\xampp\htdocs\

Ответить
ASHUTOSH DIXIT
ASHUTOSH DIXIT - 07.06.2021 07:15

such thing is free?
how

Ответить
vegeta 18
vegeta 18 - 02.06.2021 07:58

It shows undefined variable $pizza even tho i have defined it.. Plz help

Ответить
Rahul
Rahul - 31.05.2021 19:40

Such an amazing course . Love the clear explanation and concepts.

Ответить
Tabita Simorangkir
Tabita Simorangkir - 05.05.2021 21:12

mysqli_fetch_assoc() expects parameter 1 to be mysqli_result

What should I do? I already checked my code and there's no typo. Help!

Ответить
TkokFlux
TkokFlux - 27.04.2021 21:58

thank u so much I cant think you enough thanks thanks thanks ❤️

Ответить
Daniel
Daniel - 10.04.2021 22:43

Sighhh. I get confused on which quotes to use. Used a single quote to create a query and I got an uncaught type error. Using a double quote fixed this

Ответить
Eyz_Azz
Eyz_Azz - 05.04.2021 02:14

can I pass the id in a different way that is more secure??

Ответить
八幡比企谷
八幡比企谷 - 25.03.2021 13:56

do we really need to echo the $pizza['id'] in order to get the id value?

Ответить
NumberSixRule
NumberSixRule - 08.02.2021 18:49

lots of fun!

Ответить
WordPress Wisdom
WordPress Wisdom - 05.02.2021 00:10

Best tutorial. I've been searching and getting confused until I found this video. Thanks alot.

Ответить
Michael Kanios
Michael Kanios - 21.01.2021 00:11

<?php if($pizza): ?> error on line 47 ...i tried the project files from Git hub and also received that error .Please help i cant continue my lessons

Ответить
Ali Al Qahtani
Ali Al Qahtani - 08.12.2020 20:06

great :) thank you

Ответить
vishwa T
vishwa T - 21.10.2020 08:02

Hey I sent you a doubt on Instagram.
And I have another one.
In index.php I used $pizza['title'] to get the title on the webpage.
But in more info page I had to use.
$pizza['Title'] for the same database . Why do I have to change the name title for same data base can you clarify.

Ответить
Fidel García
Fidel García - 28.09.2020 23:50

course files?

Ответить
Riadhiya-الرياضية
Riadhiya-الرياضية - 07.09.2020 18:23

thank you Ninja :)

Ответить
Realswagoverlord Gaming
Realswagoverlord Gaming - 27.08.2020 19:51

You saved my ass man.

Ответить
Patrick
Patrick - 17.08.2020 09:18

For some reason, I can't get my form information to be placed in the details.php

Ответить
Irina Lyrics
Irina Lyrics - 06.08.2020 15:26

For some reason when I try to echo the id, nothing happens
<a href="details.php/?id=<?php echo $result -> id ?>"> Más información </a>
but when I try to use any other feature it works...... weird
<a href="details.php/?id=<?php echo $result -> horario ?>"> Más información </a>

Ответить
CA Aditya Yadav
CA Aditya Yadav - 05.07.2020 07:09

Hello The Net Ninja

stuck here Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in.
but when I type the id number myself on URL it displays the info correctly.
Any help with that?

Ответить
MS Jayalath
MS Jayalath - 03.07.2020 15:29

thankx

Ответить
Juan C Boly
Juan C Boly - 25.06.2020 02:15

Hi first at all, thanks for your tutorials!. Please let me ask: I have this error : Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, bool given in ...
if I use $sql = 'SELECT * FROM pizzas WHERE id = $id';
But if I use " instead have no problem.... So when do I have to realize when use single quotes or double?, thanks again for your time and videos.

Ответить
phourin
phourin - 14.06.2020 05:58

I have a problem with id of pizza! when i input data into the form then click on 'More info' and then go to url to check id, it didnt show an id like id=1 id=2 id =3..., it only show id=0; plx help:)

Ответить
Anas Pir
Anas Pir - 06.06.2020 10:19

sql does not recgonize php variable $id it gives an error
$sql = "SELECT * FROM pizzas WHERE id = $id";
the $id gives error as I remove this i can get rid of error
how can I set id to $_GET['id']
EDIT: Solved had to use prepared statement

$sql = 'SELECT * FROM users WHERE id=?';


$stmt = mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt, $sql)){

echo 'Not done sorry';
} else {

mysqli_stmt_bind_param($stmt, "s", $id);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
$member = mysqli_fetch_assoc($result);
}

Ответить
FlashStarGaming
FlashStarGaming - 30.05.2020 19:38

You are a f*cking legend !!! Your videos are the best buddy keep it up!

Ответить
Abdul Hannan Anik
Abdul Hannan Anik - 13.05.2020 20:44

Thanks a lot!

Ответить
M Shahzad
M Shahzad - 03.02.2020 13:49

thank you .
i write all you previous tuts and continue to next vadio.
the way you explain and solve every problem in form is unbelieving.

Ответить
Nguyen Trang
Nguyen Trang - 31.12.2019 04:59

hi, I have a quick question, I can see the way we get id from url. In some website we even pass user id via url, how can I secure this information, let say if they change the user id it won't redirect to other users account

Ответить
Norbert Mor
Norbert Mor - 18.11.2019 13:34

Why id without htmlspecislchars()?

Ответить
IT SKILLS ACADEMY
IT SKILLS ACADEMY - 23.10.2019 16:26

thanks dude i have been looking for this for years. i am just joking, but you saved my ass

Ответить
Lok Khadka
Lok Khadka - 10.09.2019 03:40

Thanks for a nice video! I don't have problem understanding this video until #31 but on details page i created pizza variable but the browser show error message like underdefined variable on line 33. Would you help me on this? Thanks!!

Ответить
Ali Mokhtari
Ali Mokhtari - 06.09.2019 19:45

Thanks for your great tutorial
I have a question = ( Why did you add a ? before the id )

Ответить
Mustafa Birsoz
Mustafa Birsoz - 25.08.2019 13:25

we want Ph POOP

Ответить
esceptico informal
esceptico informal - 14.03.2019 21:01

some other guys create videos of hours just to show this, you're awesome man very clear right to the point, i hope you can continue with POO in the future or maybe make some PHP advanced course in Udemy, thank you!

Ответить
Nathan Budd
Nathan Budd - 05.03.2019 01:18

Nice ninja. Hoping this extends into a PHP OOP series after 👍

Ответить
Fahri Foxtrot-Whiskey
Fahri Foxtrot-Whiskey - 04.03.2019 22:42

Magnificent! It is just so easy! Clear explanations. Fast and detailed. Love it.

Ответить
Nesrine Lach
Nesrine Lach - 04.03.2019 16:27

Merciii thanks ! God bless you ❤

Ответить
Robert Tagliavia
Robert Tagliavia - 04.03.2019 16:27

thank you :)

Ответить