TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
liniey rahman
NA
6
5.6k
How to display records from database in php?
Dec 16 2013 7:43 AM
Hello, sir.
i need your help.
im using php, want to display hotels record in table from database.
the records are displayed in order by "bestprice", the lowest price will be upper.
plss..help me.
Thanks,
Liniey
----------------------------------------------------------------------------------------
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<p> </p>
<div class="warna">
<table border="1">
<tr>
<th width="300">Hotel Name</th>
<th width="72">Stars Rating</th>
<th width="100">Agoda (RM)</th>
<th width="100">Asiarooms (RM)</th>
<th width="100">Booking (RM)</th>
<th width="100">Expedia (RM)</th>
<th width="110">Best Price (RM)</th>
</tr>
<tr>
<?php
global $wpdb;
$result = $wpdb->get_results ( "SELECT * FROM cyberjaya" );
foreach ( $result as $print ) {
echo '<td>' $print->hotelname.'</td>';
}
?>
</tr>
</table></td>
<td width="11%" bgcolor="#33FF99"> </td>
</tr>
</table>
<p>
<input type="reset" name="reset" value="Back" onClick="window.location='index.html'";>
</p>
</div>
<p>
<form action="index.html" method="post">
</p>
</body>
</html>
----------------------------------------------------------------------------------------
Reply
Answers (
2
)
How to create related dropdown list?
how to view system from localhost?