John Magee wrote: > > > > ----- Original Message ----- > From: yousuf hussain > > </table> > </form> > </td> > > </tr> > </table> > </body> > </html> > .................................................................................................................... > > > <?php > $searchText = $_REQUEST["search"]; > include "header.php"; > ?> > > include "connection.php"; > if($searchText=="syard"){ > $mySQL = "select * from addbunglow where syard='$searchText' and > isactive=1 order by bangid"; > echo "syard:".$searchText; > } > else if($searchText=="price"){ > $mySQL = "select * from addbunglow where price='$searchText' and > isactive=1 order by bangid"; > echo "price:".$searchText; > } > else { > $mySQL = "select * from addbunglow where unit='$searchText' and > isactive=1 order by bangid"; > echo "unit:".$searchText; > } > $result = mysql_query($mySQL); > $counter = 1; > while($row = mysql_fetch_array($result)) > { > ?> > <tr > > <td ><?php echo $counter;?></td> > <td ><?php echo $row["syard"];?></td> > <td ><?php echo $row["street"];?></td> > <td ><?php echo $row["phase"];?></td> > <td ><?php echo $row["unit"];?></td> > <td ><?php echo $row["catagory"];?></td> > <td ><?php echo $row["price"];?></td> > <td><?php echo $row["comments"];?></td> > </tr> > <?php > $counter = $counter + 1; > > If this is EXACTLY how you're code looks there seem to be some mistakes > in how some of your query variables are written.... > > ...from addbunglow where unit='".$searchText "' and is active-1.... > > My understanding is you have to concatenate variables while writing your > sql queries >
As long as variables are in double quotes, they expand fine. That isn't his problem.