Jump to content

mvleus

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Everything posted by mvleus

  1. hello everybody, I am totally new in the big world of PHP and SQL. I am developing a database for a union i am a member of. We wanted to add all of our members to a database! So i decided to use MySQL 4 and PHP4. I build the SQL server with the help of PHPmyAdmin and the database itself works perfectly. I build a website with Dreamweaver that contacts the SQL database. Logging in and retrieving data from the database all works perfectly too. But now i wanna add a textfield to my website where i can enter the name of a member and by pressing a button i will give the order to search the database. I already have something like this: [code] <?php include ('dbconnect.php'); ?> <h2>Unions memberlist:</h2> <b>first name:</b> <input type=text size=40 name=name> <label> <input type="submit" name="Submit" value="Search" /> </label> <br /> <br /> <?php $result = mysql_query("select * from union_members where firstname = 'Marc'") or die (mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<b>personelnumber: </b>"; echo $row["personelnumber"]; echo "<br>\n"; echo "<b>firstname: </b>"; echo $row["fisrtname"]; echo "<br>\n"; echo "<b>lastname: </b>"; echo $row["lastname"]; echo "<br>\n"; echo "<b>address: </b>"; echo $row["address"]; echo "<br>\n"; echo "<b>number: </b>"; echo $row["number"]; echo "<br>\n"; echo "<b>zipcode: </b>"; echo $row["zipcode"]; echo "<br>\n"; echo "<b>city: </b>"; echo $row["city"]; echo "<br>\n"; echo "<b>phonenumber: </b>"; echo $row["phonenumber"]; echo "<br>\n"; echo "<b>cellphonenumber: </b>"; echo $row["cellphonenumber"]; echo "<br>\n"; echo "<b>date of birth: </b>"; echo $row["date_of_birth"]; echo "<br>\n"; echo "<b>Emailaddress: </b>"; echo $row["emailaddress"]; echo "<br>\n"; echo "<br>\n"; echo "<br>\n"; } mysql_free_result($result); ?> [/code] If i open this page with my browser, the pages works perfectly. It shows me all the data i asked for. But i just dont know how to continue in order to enter the search command by entering the text in the textfield and then pressing the button. Can anyone please help me? Kind regards, mvleus
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.