Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Help a PHP noob

Name: Anonymous 2013-08-12 10:30

Hi guys. Just started tinkering in PHP.
I made a form with a dropdown box which get populated from a MYSQL database. like this:

<form name="form" method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<?php
echo  "<select name='search' onChange='this.form.submit()'>";
    while ($row = mysql_fetch_array($result)) {
        echo "<option value='" . $row['ID'] . "'>" . $row['ID'] . " </option>";
}
?>


This fetches an ID and fills the rest of the form with DB data like this:

$search=$_POST['search'];

$data = 'SELECT * FROM `tlbintake` WHERE `ID` = "'.$search.'"';
  $query = mysql_query($data) or die("Couldn't execute query. ". mysql_error());
  $data2 = mysql_fetch_array($query);


Everything works correctly but after selecting an ID from the dropdownbox it fills in all the data correctly but it resets the ID to the "first" ID in the list.

How can I make it show the correct ID in stead of the first one?

Name: Anonymous 2013-08-12 11:07

>>3
Kudos to Niggers for destroying the language and the culture of every country in which they are found! Just think about it ... they are the only ethnic group who can be in the USA for more than 1-2 generations without sounding like a native English speaker. Even native Mandarin Chinese speakers who come to the USA have children who sound like native English speakers. Niggers have had how many hundreds of years now? Oh but we're supposed to call it "Ebonics" and pretend like this is somehow not a failure of theirs. Better to fuck up the entire language for everyone than to tell a 13% minority to get with the program. Brilliant! Don't worry, at least that way everyone's widdle feelings won't get hurt. Because that's more important than anything else, right? Right, you pantywaists?!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List