I am working on a web application with php and mysql. Where I am trying to display searched result as following:
----------------------------------------------------------
: Model1 Diescription Price :
: => Model1-Version1 Discription Price :
: => Model1-Version2 Discription Price :
: => Model1-Version3 Discription Price :
..........................................................
: Model2 Diescription Price :
: => Model2-Version1 Discription Price :
: => Model2-Version2 Discription Price :
: => Model2-Version3 Discription Price :
..........................................................
I am beginner in this field , so I don't know what it called.
Suppose I have Table (t):
------+------+-------+---------+-------+-------------+
carID : make : model : version : price : discription :
------+------+-------+---------+-------+-------------+
1 : BMW : XX1 : v1 :2345235: Best Car :
------+------+-------+---------+-------+-------------+
2 : BMW : XX1 : v2 :33235 : Good Car :
------+------+-------+---------+-------+-------------+
3 : Audi : p1 : vp1 :2345 : Best Car :
------+------+-------+---------+-------+-------------+
Search Query:
SELECT carID FROM t WHERE price>=2000;
In my research I found this website, using same search display. It may help here
Thank Your for help
I don't understand so much your question... Do you want only show data?
See this...
$query = 'SELECT carID FROM t WHERE price>=2000';
$result = mysql_query($query) or die('Error: ' . mysql_error());
echo ('<table width="200" border="1">
<tr>
<td>carID</td>
<td>make</td>
<td>model</td>
<td>version</td>
<td>price</td>
<td>discription</td>
</tr>');
while ($row = mysql_fetch_assoc($result)) {
echo('<tr>
<td>' . $row['carID'] . '</td>
<td>' . $row['make'] . '</td>
<td>' . $row['model'] . '</td>
<td>' . $row['version'] . '</td>
<td>' . $row['price'] . '</td>
<td>' . $row['discription'] . '</td>
</tr>');
}
echo('</table>');