Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with my php code. This is my code, this is my output, but i dont want it to be horizontal like this

I need help with my php code. This is my code,

$servername = "localhost";

$username = "root";

$password = "";

$dbname = "student";

// Create connection

$conn = new mysqli($servername, $username, $password, $dbname);

// Check connection

if ($conn->connect_error) {

die("Connection failed: " . $conn->connect_error);

}

//create and execute query

$sql = "SELECT * FROM studentdata";

$result = $conn->query($sql);

//check if records were returned

if ($result->num_rows > 0) {

//create a table to display the record

echo '

';

echo '

';

// output data of each row

while($row = $result->fetch_assoc()) {

echo '

';

echo '

';

echo '

';

echo '

';

echo '

';

echo '

';

echo '

';

echo '

';

}

}

else {

echo "0 results"; //if no record found in the database

}

//close connection

$conn->close();

?>

image text in transcribedthis is my output, but i dont want it to be horizontal like this

image text in transcribedi want it to be Vertical like this and i done so many thing and still failed. pls help me. tq so much

localhost/finalproject/view.php Home FAQ About STUDENT INFORMATION DATABASE WEB SYSTEM Name IdentificationCard Email Gender Religion Nation Phone Number Search Delete MUHAMMAD AZIM BIN ABDUL HAD 970709085185 azimhadi63@gmail.com male ISLAM MELAYU 0129495567 suzana binti zaini 730208086232 suzana123@gmail.com Female ISLAM MELAYU 01459238123 localhost/finalproject/saveRegistrationNew.php Home FAQ About View Student Data STUDENT INFORMATION DATABASE WEB SYSTEM STUDENT INFORMATION DATABASE WEB SYSTEM Date: 03-03-2021 Student Information Name Identification Card Email Gender Religion Nation Phone Mobile Address - Sofiyyah - 970709085189 sofi@gmail.com : Female ISLAM : MELAYU : 0153325367 055256673 11, PERSIARAN PUNCAK JELAPANG 9, PUNCAK JELAPANG MAJU 30020 IPOH PERAK
Name IdentificationCard Email Gender Religion Nation Phone Number Search Delete
'.$row["Name"].''.$row["IdentificationCard"].''.$row["StudentEmail"].''.$row["StudentGender"].''.$row["StudentReligion"].''.$row["StudentNation"].''.$row["StudentMobile"].'

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions