Dear all,
I am trying to figure out the code needed to search the DB for a name (textbox input) and then display the record with that name.
This is the form so far:
<?php if ( isset($name) ): ?>
<P>Your name: <?php echo($name); ?></P>
<P>This paragraph contains a
<A HREF="newpage.php?name=<?php echo(urlencode($name)); ?>">
link</A> that passes the name variable on to the next document.</P>
<?php else: ?>
<!-- prompt the user for a name. -->
<FORM ACTION="<?php echo($PHP_SELF); ?>" METHOD="GET">
Name : <INPUT TYPE="TEXT" NAME="name">
<INPUT TYPE="SUBMIT" VALUE="GO">
</FORM>
<?php endif; ?>
I guess it should be something like this with an if / else:
$stmt = mysql_query("SELECT * FROM teilnehmer WHERE $name LIKE '%$search%' ");
can anyone help?