<html>
<head>
</head>
<body>
<table border='1'>
<tr>
<th>Agent_ID</th>
<th>Address</th>
<th>Bedrooms</th>
<th>Price</th>
<?php
$connect=mysql_connect("localhost","root","");
mysql_select_db("ong_assesment',$connect);
$query = mysql_query (SELECT Agent_ID,Address/Suburb,Bedrooms/Bathrooms,Price FROM suburbs);
{
echo '<tr>';
echo '<td>'. $row[Agent_ID].'</td>';
echo '<td>'. $row[Address].'</td>';
echo '<td>'. $row[Bedrooms].'</td>';
echo '<td>'. $row[Price].'</td>';
echo '</table>'
mysql_close();
}
?php>
</body>
</html>
dean.ong.14
-11
Junior Poster in Training
Recommended Answers
Jump to PostPlease post your script, how it looks now.. Removing any passwords etc..
Jump to PostLook at the syntax, if you have to explain what the script does, then it's pretty self-explanatory.. I cannot do your work for you, that wouldn't be fair and I'm sure you actually want to learn something ;) I'll help you a bit though:
- Explain what PHP is
- Explain the …
Jump to Postif(!mysql_affected_rows() >= 1)
Does not work with SELECT, only INSERT, UPDATE, REPLACE or DELETE.
Also you're trying to loop twice.
The function you're looking for is mysql_num_rows:
<?php $connect=mysql_connect("localhost","root",""); $db_selected = mysql_select_db("ong_assessment", $connect) $query = "SELECT Agent_ID,Address,Bedrooms,Price FROM suburbs"; $result = mysql_query($query) or …
Jump to PostIf this is solved now, please mark it so and give rep to those who helped you :)!
Jump to PostIF this thread has been solved, please mark is as solved and give rep to those who helped you :)!
All 35 Replies
diafol
dean.ong.14
-11
Junior Poster in Training
neha_jaltare
0
Newbie Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
diafol
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
phorce
131
Posting Whiz in Training
Featured Poster
dean.ong.14
-11
Junior Poster in Training
diafol
phorce
131
Posting Whiz in Training
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.