Sedang Disiapkan

PHP Mysql Example

I need a script made so i can use it as an example that I can use to code other pages with similar needs. I need this today. So bid now if you can do it this NOW!

I have a drop down menu that gets its values from a Mysql database and table called via. What I want to do is once someone chooses the company they want it will give me the phone number and email that is in the database for that company on the same page. here si what I got so far. The menu is getting the Company name form the table but I can not get it to show the specific Company Phone Number and Email for that company. All I can get is the first entry in the table called via. But I need it to change to show the company that is chosen by the dro down menu.

This what I have - I am trying to learn basic things so I need soem help with this..

<?

$dbhost = "localhost";

$dbname = "name";

$dbuser = "user";

$dbpass = "pass";

mysql_connect($dbhost,$dbuser,$dbpass);

mysql_select_db($dbname);

$sql="select * from via";

$result=mysql_query($sql);

$zeile = mysql_fetch_array($result);

?>

<form action="<?=$_SERVER['PHP_SELF']?>" method="post">

<?php

$query5 = "select * from via ORDER BY Customer_Company";

echo "<select name=\"Customer_Company\">";

$result5 = mysql_query($query5);

echo "<OPTION selected>$Customer_Company";

while ($row=mysql_fetch_array($result5))

{

$Customer_Company=$row["Customer_Company"];

echo "<option>$Customer_Company";

}

echo "</select>";

?>

<br />

<input type="submit" name="button" id="button" value="Search by Customer Name" /></form>

//Then I want to have it add to my html page the Phone number and email on the same page below it.//

Customer Phone Number: <?php echo "$zeile[Customer_Phone_Number]" ?>

Customer Email: <?php echo "$zeile[Customer_Email_Number]" ?>

// this entry works but only shows the first record in the table I need it to show the Phone and Email for the company that was selected from the drop down.//

Stephen Bryant

Kemahiran: PHP

Lihat lebih lanjut: php mysql example, mysql example, php mysql examples, samples php mysql forms, example mysql project, php mysql example project, select mysql example, php mysql sql example, mysql php example, mysql customer database, learn sql, want learn php, customer database php mysql, php select show page, select example php exemple, php example, complete php mysql samples, mysql php example project, msq steve bryant phone, php show entry mysql, mysql example telephone list, php mysql example sign, examples mysql php table, select type phpmysql, php mysql example form

Tentang Majikan:
( 22 ulasan ) LaFargeville, United States

ID Projek: #373812

Dianugerahkan kepada:

leoe

It's done, please check your PMB for see it working. Thanks. Leo.-

$30 USD dalam 0 hari
(105 Ulasan)
6.6

9 pekerja bebas membida secara purata $32 untuk pekerjaan ini

toinnisfree

quick pro help

$50 USD dalam sehari
(757 Ulasan)
8.3
TakeReal

I can help you. I can write code to show "phone" and other details.

$30 USD dalam sehari
(1531 Ulasan)
7.8
jexplorer

Please check PMB. jexplorer

$30 USD dalam 0 hari
(170 Ulasan)
7.2
ichurakov

Hello. Let me help you. Pls, check PMB. Thnx.

$30 USD dalam 0 hari
(215 Ulasan)
6.3
www6STECHcom

Ready to start! Please check PMB

$30 USD dalam sehari
(35 Ulasan)
5.8
fastphp

Will complete quikcly.

$30 USD dalam 0 hari
(29 Ulasan)
5.6
rshyethmusthafa

I can do this

$30 USD dalam sehari
(26 Ulasan)
4.7
vlip

Hello. I will do my best to help you. Thanks.

$30 USD dalam sehari
(23 Ulasan)
4.1