PHP MySql Fetch multiple data

PHP MySql Fetch multiple data

php-mysql video-tutorials

9 лет назад

51,507 Просмотров

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


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

pikachu
pikachu - 20.08.2022 16:37

thanks boy

Ответить
Syed Hassaan Haider Naqvi
Syed Hassaan Haider Naqvi - 02.07.2021 15:28

how to fetch data from table id to another table head like personal info ??

Ответить
Akash Singh Chauhan
Akash Singh Chauhan - 05.02.2021 12:26

$db=mysqli_select_db($conn,"student");
this statement helped a lot thanks you geek....

Ответить
Mayank Sharma
Mayank Sharma - 04.08.2020 08:35

how to fetch jsonArray from android to php plz help this problem

Ответить
trio123
trio123 - 21.07.2020 14:47

Bro how can we fetch particular data with unique id from same database

Ответить
Marco Alvarado
Marco Alvarado - 12.05.2020 11:48

You should seperate the logic and the view! Not making an output within the while loop.

Ответить
Harraz Masri
Harraz Masri - 29.11.2019 14:56

thanks bro

Ответить
Keith Scull
Keith Scull - 20.11.2019 09:14

PHP changes shit too much.. all the MySQL commands don't work on latest version

Ответить
aLLiN
aLLiN - 13.08.2019 23:48

thx bro helped me much :)

Ответить
Shrinjoy Saha
Shrinjoy Saha - 29.06.2019 13:52

Great video man

Ответить
mugabi samuel
mugabi samuel - 26.09.2018 18:18

thanks for the tut

Ответить
ASIF ROCK
ASIF ROCK - 04.07.2018 15:40

How to fetch multiple row using chechbox

Ответить
Jlayin Ronchi
Jlayin Ronchi - 20.03.2018 18:16

How to fetch my SQL data using div tag ?

Ответить
Nur Naafizah Mohammad Rapi
Nur Naafizah Mohammad Rapi - 17.02.2018 06:31

hye i have done my coding, but i want to display from a same username to see their own multiple data, but for now i can only display one data from same username. would you mind to check my coding.




<?php
session_start();
?>
<?php

$servername = "localhost";
$username = "root";
$password = "mysql";
$dbname = "Online";

//Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
//Check connection
if (mysqli_connect_error())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

$result = mysqli_query($conn, "SELECT * FROM Booking WHERE Username = '{$_SESSION['Username']}'" );
while($row = mysqli_fetch_array($result))



{
$BookingID= $row['BookingID'];
$UserID= $row['UserID'];
$Username= $row['Username'];
$Department= $row['Department'];
$Room= $row['Room'];
$StartDate= $row['StartDate'];
$EndDate= $row['EndDate'];
$StartTime= $row['StartTime'];
$EndTime= $row['EndTime'];
$Reason= $row['Reason'];
}

mysqli_close($conn);
?>

<body>
Booking ID:<? echo $BookingID;?><br>
User ID:<? echo $UserID;?><br>
Username:<? echo $Username;?> </b></span><br>
Department:<? echo $Department;?><br>
Room:<? echo $Room;?><br>
Start Date:<? echo $StartDate;?><br>
End Date:<? echo $EndDate;?><br>
Start Time:<? echo $StartTime;?><br>
End Time:<? echo $EndTime;?>

<br><br>

Booking ID:<? echo $BookingID;?><br>
User ID:<? echo $UserID;?><br>
Username:<? echo $Username;?> </b></span><br>
Department:<? echo $Department;?><br>
Room:<? echo $Room;?><br>
Start Date:<? echo $StartDate;?><br>
End Date:<? echo $EndDate;?><br>
Start Time:<? echo $StartTime;?><br>
End Time:<? echo $EndTime;?>


</body>

Ответить
Constantine
Constantine - 13.12.2017 15:35

Very clean tutorial keep it up mate and big tha ks :)

Ответить
Predator
Predator - 29.06.2017 12:56

voice and language is very clear and good keep it up

Ответить
Predator
Predator - 29.06.2017 12:55

good work dear i raelly need this.....tahnku so much

Ответить
Ole Kristian Møller-Hansen
Ole Kristian Møller-Hansen - 16.06.2017 02:05

Greetings. I can not seem to get this to work.
I can confirm that my SQL-database got DATA in it's table by using mysqli_num_rows,
but the while-loop simply won't perform the action inside the loop body.

while ($row = mysqli_fetch_array($entries)) {
echo 'Hello' . $row[2] . 'Bye';
}

Ответить
Riffat Saleem
Riffat Saleem - 21.01.2017 17:46

what if we want to display data from multiple tables?

Ответить
Slender Man
Slender Man - 19.02.2016 07:26

what if i just want to display the 2nd value? whats the code?

Ответить