1 لدى بيانات معينة و لنفترض مثلا ( اشخاص) نجحت فى اضافة هذة البيانات عن طريق صفحة خاصة تشمل اسم الشخص العنوان التليفون الفاكس الجوال الموقع الاليكترونى (ان وجد) والبريد الاليكترونى
2 ارغب فى عمل صفحة يتم فيها البحث عن بيانات هؤلاء الاشخاص عن طريق الاسم وعرض باقى البيانات طبقا للإسم الذى تم اختيارة و بناء على هذا تم عمـل قائمة منسدلة ( Drop down list ) على ان تأخذ محتوياتها من اسماء الاشخاص الموجودين فى قاعدة البيانات من العمود الخاص بالاسماء و باختيار الاسم المطلوب للشخص يتم عرض باقى بياناته اسفل الصفحة فى جدول مخصص لهذا
يلاحظ انة مطلوب اذا تم اضافة اى اسماء اشخاص جدد ضمن هؤلاء الاشخاص ان تظهر هذة الاسماء تلقائيا فى القائمة المنسدلة ( Drop down list )
ارجو ان اجد من يساعدنى فى حل هذة المشكلة حيث اننى منذ عدة ايام لاهم لى الا المحاولات العديدة فى التوصل لحل لها ولكن كل هذة المحاولات فشلت
Dear Friends
i,m facing a problem with PHP & hope that any one of you help me about it
i,m building a new script whice contains data about persons for example Name Address Telephone number E mail Website if found
all these were added succesfully into data base
i,m trying to build a search page to search these persons by name
i established a drop down list & i want it to include the names (including any prospective new commers)
by selecting a name i want all the data concerning this selected person to be shown on the same page & sure to be changed if another one is selected
i really need your help about it cause i tried alot about it but it did not work can any one guide me how to do it right
thank you
help me with this code problem
Moderator: General Moderators
-
mostafa581
- Forum Newbie
- Posts: 3
- Joined: Sat Apr 26, 2008 5:37 pm
Re: help me with this code problem
Are you going to have a lot of data?
If you do. A drop down is not the best way. It should just be a text field.
is something similar to this. For the database connection stuff use adodb(http://adodb.sourceforge.net/) or mysql calls.
If you do. A drop down is not the best way. It should just be a text field.
is something similar to this. For the database connection stuff use adodb(http://adodb.sourceforge.net/) or mysql calls.
Code: Select all
<form action="search.php" method="post">
<input type="text" id="person_name" name="person_name">
<input type="submit" id="submit_btn" value="search">
</form>
<?
if isset($_POST['submit_btn']){
$person_name = $_POST['person_name'];
$sql = "select * from mydata where person_name like '%{person_name}%";
//connect to database
//execute query
//foreach result
//echo data
}
?>
Re: help me with this code problem
Guarantee this person NEVER comes back to say thanks.
-
mostafa581
- Forum Newbie
- Posts: 3
- Joined: Sat Apr 26, 2008 5:37 pm
Re: help me with this code problem
i appologize for not signing in after posting this topic before now
thank you yacahuma for your kind assistance i don,t have much data to show it is about 20 to 25 no more but i,ll use the same way to show other items which contains more data may be in hundreds so i know that drop down list is not the right choice in such case
i,ll apply this code to my page & tell you the result
again thank you
thank you yacahuma for your kind assistance i don,t have much data to show it is about 20 to 25 no more but i,ll use the same way to show other items which contains more data may be in hundreds so i know that drop down list is not the right choice in such case
i,ll apply this code to my page & tell you the result
again thank you