Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
okay so I am dealing with a mysql DB and I am making it for car(make, model, year, price and so on) now here is part of the scrip I am using to filter by make....Code: Select all
<?php
mysql_connect($dbhost,$dbuser,$dbpass) or die("Unable to connect");
@mysql_select_db($dbname) or die ("Unable to select database");
$query="SELECT * FROM $tbl_listings WHERE make = 'chevy'";
$result=mysql_query($query);
$num=mysql_numrows($result);
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$make=mysql_result($result,$i,"make");
$model=mysql_result($result,$i,"model");
$year=mysql_result($result,$i,"year");
$price=mysql_result($result,$i,"price");
?>
//Display information code
<?
$i++;
}
mysql_close(mysql_connect($dbhost,$dbuser,$dbpass));
?>Code: Select all
$query="SELECT * FROM $tbl_listings";Code: Select all
$query="SELECT * FROM $tbl_listings WHERE model = 'Civic'";Code: Select all
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/sitename/public_html/test/admin/admincp.php on line 64[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]