47: Inserting database results into array in PHP - PHP tutorial

preview_player
Показать описание
Inserting database results into array in PHP - Learn PHP backend programming. Today we will learn how to insert data from a database table into an array.

➤ 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 :)

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

Man you 're a life saver..Still helpful in 2023
👌

roykossley
Автор

The content delivery style is excellent. No Fluff. I loved that.

Kodeispoetry
Автор

Hi daniel, thans god you very help me out on my final project. This was very perfect solver for machine learning development. Love you, i'll promote ur channel as i cant give nothing. I am from indonesia btw. Thx

fadhilaasyam
Автор

Hello Daniel,

Just a heads up when you show us a dump from a print_r then instead of just doing that, so it looks so messy, then arooung the print_r(); you can echo '<pre>' and close it after the print_r functions like echo '</pre>' and you will get a much more clean look..

appleproahed
Автор

Thank you dude, im currently at my exams and you really helped me out. You dont know how much you helped people around the word with this video <3

toast_hawaii
Автор

This gives me a head start, because i code in another class which doesn't give the require output on my code thanks a bunch.

alrenjaygabasan
Автор

OMG, thx bro. I'm about 10 days can't understand how this work. This video is helpfull!

abzalbotbayev
Автор

thank you so much!! you help me for my database project for the university (hello from Athens)

nikolaoschairopoulos
Автор

really you have awesome way in explain

nogafouz
Автор

1:24: "Which I know is not correct" Big LOL!!! 🤣

noahbroyles
Автор

very well explained! Thank you so much!

invsg
Автор

very nice approach of explanation.Thank you, sir.

LearnProgrammingYourself
Автор

For a better overview of your array do this:

<?php

echo '<pre>';
print_r($datas);
echo '</pre>';

cacurazi
Автор

if I could slam a super like button i had done so! thank you my fine sir :D !

Holycrabbe
Автор

Hey,
I learn a lot from this channel. I'm just a beginner in php and mysqli.
Yet I already have a compexe question. I am looking for a code / instruction how to make a matrix (multiple dimensional array (I don't know)).

What I have is a three table database
table 'user' a table 'role' and a connection table 'person2role'.

Now I am looking at how I can display the roles horizontally and the users vertically.
where the tables intersect should be a +.


for example:
role1 role2 role3
user1 x
user2 x x
user3 x

KwibusOnTour
Автор

Would it not be better if you use references like : 1D Arrays -> | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
2D Arrays -> | 00 | 01 | 02 | 03 |
| 10 | 11 | 12 | 13 |
| 20 | 21 | 22 | 23 |
| 30 | 31 | 32 | 33 |

3D Arrays -> as cubes
instead of just saying multi-dimensional array

Also you should explain how the mysqli_query() function returns the result like

id text

0 | 1 | Hi | -> Array 1
1 | 2 | there | -> Array 2
2 | 3 | friend | -> Array 3

ResultArray = ( Array1, Array2, Array3 ) ;

pushparajvaghela
Автор

Hello nice tuts. I HAVE A QUESTION. Related to array, can you explain why we put html input checkbox name= "checkbox [ ] " . How those brackets as key can turn into value in an array? I dont get it. Thanks pal you awesome.

paulklimenko
Автор

For printing all the rows you can try that:
for($i = 0; $i < (mysqli_num_rows($result)); $i++){
foreach($data[$i] as $item){
echo $item." ";
}
echo "<br>";
}

eminaliyev
Автор

why do you name the part which is connecting to the database and executing a piece of sql code $result ? wouldnt $execute or $sqlCode be better?

peterlustig
Автор

Could this be applied to a java program instead of a website and still work correctly?

Kristin-yfrq
visit shbcf.ru