Hi listfellows!

Okay, I'm trying to make a form talk to a SELECT query using PHP. How do I 
make input from a form become a PHP variable?

This is how far I've gotten:

<?php
function search_records() {
    ?>
             <form name="form1" method="post" action="<?php echo 
"$PHP_SELF?action=list_records&title=$formtitle"; ?>">
               <input type="text" name="$formtitle"><input type="submit" 
name="Submit" value="GO">
             </form>
             <? } ?>

Now underneath this I have a function list_records() with a page that is 
supposed to list the records.

    $query = "SELECT title FROM $user_tablename WHERE title REGEXP '$formtitle'
   $order_by_str $sort_order_str $limit_str";


This will work if I tell it to select all the records and display them, but 
if told to use the $formtitle information it says "empty (sub) expression 
from REGEXP."

Any help is appreciated! Thanks!

Nate


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to