RE: [PHP-DB] PHP3 / Access DB

From: Date: Wed, 31 May 2000 11:01:09 +0000
Subject: RE: [PHP-DB] PHP3 / Access DB
Groups: php.db 
Request: Send a blank email to php-db+get-130@lists.php.net to get a copy of this message
To input criteria for search - file form.html ...... <FORM ACTION="search.phtml" METHOD="post"> Enter custormer name here:<INPUT TYPE="text" NAME="form_customer_name" SIZE="30"> <INPUT TYPE="SUBMIT"> </FORM> ..... Dots stand for rest of PHP or HTML code - whatever You want. Number of input fields in form section is up to You also. NAME field in input field definition is passed to ACTION script and You can use it as a variable. Search engine - file search.phtml ...... $search_qry=mssql_query("SELECT * FROM my_database WHERE CUSTOMER_NAME=$form_customer_name;", $connection); ...... Dots for rest of code. I'm working with MS SQL - that's why I'm using it as an example. But syntax of Your query is almost always the same. PHP takes value of $form_customer_name and puts it in query. This is universal method of passing varables from one script to another. -- -- Marcin Żylski, dział IT -- email: marcin.zylski@upc.com.pl -- tel. +48 32 20 07 485 -- -----Original Message----- From: Tim Hulen [mailto:thulen@yahoo.com] Sent: Tuesday, May 30, 2000 8:49 PM To: php-db@lists.php.net Subject: [PHP-DB] PHP3 / Access DB How do I define variables so a user can input a criteria to query on, i.e select * from table1 where date = (variable); from a form of something like that. Thanks in advance Tim ===== "Hokey religions and ancient weapons can never compare to a good blaster at your side, Kid." May all your bubbles be external. __________________________________________________ Do You Yahoo!? Kick off your party with Yahoo! Invites. http://invites.yahoo.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#130) next »