PDA

View Full Version : نمایش نتیجه جستجو در textbox



farshad1_1390
یک شنبه 07 خرداد 1391, 14:22 عصر
با سلام.میخواستم بپرسم که چطوری نتیجه جستجویی مثل کد زیر رو داخل textbox میتونم نشون بدم! با تشکر




<?php $con = mysql_connect("localhost","root","");
if (!$con){die('Could not connect: ' . mysql_error());}
mysql_select_db("news", $con);
$result = mysql_query("SELECT * FROM link where title='$_POST[searchl]'");
while($row = mysql_fetch_array($result))
{
echo $row['adress'] . " " . $row['title'];
echo "<br />";
}
?>

colors
یک شنبه 07 خرداد 1391, 14:35 عصر
درود

چیشو تو textbox قرار بدی؟ adress یا title
میتونی مثل زیر خودت ویرایش کنی



<?php $con = mysql_connect("localhost","root","");
if (!$con){die('Could not connect: ' . mysql_error());}
mysql_select_db("news", $con);
$result = mysql_query("SELECT * FROM link where title='$_POST[searchl]'");
while($row = mysql_fetch_array($result))
{
echo '<input name="" type="" value="'.$row['adress'].'"><input name="" type="" value="'.$row['adress'].'">';
echo "";
}
?>

persian-boy
یک شنبه 07 خرداد 1391, 14:37 عصر
<?php $con = mysql_connect("localhost","root","");
if (!$con){die('Could not connect: ' . mysql_error());}
mysql_select_db("news", $con);
$result = mysql_query("SELECT * FROM link where title='$_POST[searchl]'");
while($row = mysql_fetch_array($result))
{
echo "<input type='text' name='address' value='".$row['adress'].$row['title']."' /><br>";
}
?>


موفق باشید