[PHP-DB] PHP/Mysql search
Hello, Please be patient and assist meI am building a web application where a search function is required. I have a number of drop down lists from which a user has to select what they are searching for..they may choose to do a multi-fields search or search only one. Are there any resources you can point me to which implements something like this? Eustace
RE: [PHP-DB] PHP/Mysql search
Thanks, I have somewhere to start! Eustace -Original Message- From: Bastien Koert [mailto:[EMAIL PROTECTED] Sent: Monday, May 22, 2006 4:10 PM To: [EMAIL PROTECTED]; php-db@lists.php.net Subject: RE: [PHP-DB] PHP/Mysql search http://www.weberdev.com/get_example-4236.html is an example that I wrote that does this bastien From: Eustace [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: php-db@lists.php.net Subject: [PHP-DB] PHP/Mysql search Date: Mon, 22 May 2006 14:58:59 +0200 Hello, Please be patient and assist meI am building a web application where a search function is required. I have a number of drop down lists from which a user has to select what they are searching for..they may choose to do a multi-fields search or search only one. Are there any resources you can point me to which implements something like this? Eustace -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Internal Virus Database is out-of-date. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.5.6/336 - Release Date: 5/10/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] multi-table insert
Thanks Chris! Appreciate the help! Eustace -Original Message- From: Chris [mailto:[EMAIL PROTECTED] Sent: Monday, May 01, 2006 3:23 AM To: [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: Re: [PHP-DB] multi-table insert Eustace wrote: Hello everybody! I am very much a newbie in PHP, but enjoying the learning process. Here and there I get tangled in the logic of certain problems. Anyway, I have a database about interns and this database has multi-tables told data of interns, for example personal information, education qualifications, computer skills, languages etc. The relationship of the tables is based on the intern's username. What I am trying to do is have a form, which an intern can fill in so that details are inserted into the database. Since I am populating a number of tables in one go, what's the best way to implement this? The main table is the personal information one, which has the username as primary key, and the rest of the tables username is the foreign key. Obviously I need the to pick the username from the main table and insert it into the other tables. How best can I do this? No databases will do this automatically for you (whether you use mysql, sqlite, postgresql or something else), so you need to create multiple queries: mysql example: $query = insert into users(username) values ('my_username'); mysql_query($query); $userid = mysql_insert_id(); $query = insert into table2(userid) values('$userid'); postgres example: $query = select nextval('user_sequence') AS nextid; $result = pg_query($query); $row = pg_fetch_assoc($result); $userid = $row['nextid']; $query = insert into table2(userid) values('$userid'); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.385 / Virus Database: 268.5.1/328 - Release Date: 5/1/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] multi-table insert
Hello everybody! I am very much a newbie in PHP, but enjoying the learning process. Here and there I get tangled in the logic of certain problems. Anyway, I have a database about interns and this database has multi-tables told data of interns, for example personal information, education qualifications, computer skills, languages etc. The relationship of the tables is based on the intern's username. What I am trying to do is have a form, which an intern can fill in so that details are inserted into the database. Since I am populating a number of tables in one go, what's the best way to implement this? The main table is the personal information one, which has the username as primary key, and the rest of the tables username is the foreign key. Obviously I need the to pick the username from the main table and insert it into the other tables. How best can I do this? Sorry this is a bit like an essay, but please assist. I know it looks obvious to the experienced guys, but am having a bit of a problem. Thanks Eustace
[PHP-DB] Mysql/PHP5 connection error
Hello, I hope somebody can assist. I am using dreamweaver 8, Mysql, PHP5 for a simple we application. After using the dreamweaver wizard to make a connection, then created a recordset. Trouble starts when I use require_once(connections/ConnSAFDEM) to link to the database connection file. I get the error below. If I hand code the connection and recordsets things work fine as long as I am not using the require, require_once, include functions. I installed PHP recently on IIS (manual installation). I am wondering if I am mssing something which is stopping those functions to work? Warning: require_once(Connections/connSAFDEM.php) [ http://localhost/safdem_web/Admin/function.require-once function.require-once]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\safdem_web\Admin\add_vacancy.php on line 1 Fatal error: require_once() [ http://localhost/safdem_web/Admin/function.require function.require]: Failed opening required 'Connections/connSAFDEM.php' (include_path='.;C:\php5\pear') in c:\Inetpub\wwwroot\safdem_web\Admin\add_vacancy.php on line 1
RE: [PHP-DB] Mysql/PHP5 connection error
Thanks. That's the mind boggling part, the file does exist, correct case, correct path! Dreamweaver does ship the files automatically to the testing server..and I checked to make sure! -Original Message- From: chris smith [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 14, 2006 12:04 PM To: [EMAIL PROTECTED] Cc: php-db@lists.php.net Subject: Re: [PHP-DB] Mysql/PHP5 connection error On 3/14/06, Eustace [EMAIL PROTECTED] wrote: Hello, I hope somebody can assist. I am using dreamweaver 8, Mysql, PHP5 for a simple we application. After using the dreamweaver wizard to make a connection, then created a recordset. Trouble starts when I use require_once(connections/ConnSAFDEM) to link to the database connection file. I get the error below. If I hand code the connection and recordsets things work fine as long as I am not using the require, require_once, include functions. I installed PHP recently on IIS (manual installation). I am wondering if I am mssing something which is stopping those functions to work? Warning: require_once(Connections/connSAFDEM.php) [ http://localhost/safdem_web/Admin/function.require-once function.require-once]: failed to open stream: No such file or directory in c:\Inetpub\wwwroot\safdem_web\Admin\add_vacancy.php on line 1 Did you read the error message? No such file or directory That means the file Connections/connSAFDEM.php doesn't exist. It could be: - wrong path - wrong case - file really doesn't exist. -- Postgresql php tutorials http://www.designmagick.com/ -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.375 / Virus Database: 268.2.1/279 - Release Date: 3/10/2006 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php