| | |
Filling in form for users
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2005
Posts: 11
Reputation:
Solved Threads: 0
Hi
It's been awhile since I had a question, thanks for helping me out before. Now I have another question.
I have 50 plus doctors that I have a DB table, I was told that I only needed one table but I could not figure out how. Well I figured it out.
I have one form and a register form that all my doctors fills out for placing orders.
The register form contains the names, username, passcode, room, bldg, etc.
what I want to do is when a doctor signs in his information is automatically filled in using the register information that was fill out at signup.
Before it was easy all I had to do is use $x_Investigator = "Name",
$x_Room = "604", etc.
Using one form for everyone makes it impossible to do that.
Does anyone know how I can have the form automatically populate with the information given in the registeration form?
Thanks
L
It's been awhile since I had a question, thanks for helping me out before. Now I have another question.
I have 50 plus doctors that I have a DB table, I was told that I only needed one table but I could not figure out how. Well I figured it out.
I have one form and a register form that all my doctors fills out for placing orders.
The register form contains the names, username, passcode, room, bldg, etc.
what I want to do is when a doctor signs in his information is automatically filled in using the register information that was fill out at signup.
Before it was easy all I had to do is use $x_Investigator = "Name",
$x_Room = "604", etc.
Using one form for everyone makes it impossible to do that.
Does anyone know how I can have the form automatically populate with the information given in the registeration form?
Thanks
L
You will have to retrieve the registration info for the doctor from the database, and populate the current for with this information.
Are you familiar with SQL?
Are you familiar with SQL?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
•
•
Join Date: Jul 2005
Posts: 11
Reputation:
Solved Threads: 0
I know about SQL and seen what the code looks like when creating tables but that's it.
Are you saying I have to write a sql code that will populate my form? That would be way off my scope of knowledge but if you stir me the right direction I would appreciate it. Where would I find sample code to study from?
Thanks
Larry:-)
Are you saying I have to write a sql code that will populate my form? That would be way off my scope of knowledge but if you stir me the right direction I would appreciate it. Where would I find sample code to study from?
Thanks
Larry:-)
Take a look at PHP's docs on mysql_fetch_assoc() : http://www.php.net/manual/en/functio...etch-assoc.php
(I assume you're using MySQL. )
The first example on that page uses the following functions:
mysql_connect() - http://www.php.net/function.mysql-connect
this connects to your db.
mysql_query() - http://www.php.net/manual/en/function.mysql-query.php
This queries the mysql DB.
mysql_error() - http://www.php.net/manual/en/function.mysql-error.php
This echo's the last error message generated for your msql connection.
Finally,
mysql_fetch_assoc() - http://www.php.net/manual/en/functio...etch-assoc.php
This allows you to fetch an associative array of the rows in the query result.
Since you're already using a db, you should already have a database class? Just use it to select the row that matches the current doctor and fill in the form with the results..
(I assume you're using MySQL. )
The first example on that page uses the following functions:
mysql_connect() - http://www.php.net/function.mysql-connect
this connects to your db.
mysql_query() - http://www.php.net/manual/en/function.mysql-query.php
This queries the mysql DB.
mysql_error() - http://www.php.net/manual/en/function.mysql-error.php
This echo's the last error message generated for your msql connection.
Finally,
mysql_fetch_assoc() - http://www.php.net/manual/en/functio...etch-assoc.php
This allows you to fetch an associative array of the rows in the query result.
Since you're already using a db, you should already have a database class? Just use it to select the row that matches the current doctor and fill in the form with the results..
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- system command not working in C functions.pls help (C)
- Form - really confused - Please help!!! (HTML and CSS)
- receiving data from a form in PHP? (PHP)
- E-mail form data quick and easily with PHP (PHP)
- Problems in Dynaform (Form Mail) URGENT HELP (PHP)
Other Threads in the PHP Forum
- Previous Thread: Setting a Session Cookie
- Next Thread: How to get the Mp3 song length?
| Thread Tools | Search this Thread |
advanced apache api array basics beginner binary broken cakephp check checkbox class cms code codingproblem combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert ip javascript job joomla js limit link login mail menu mlm mobile multiple mysql nodes oop outofmemmory paging parse password paypal pdf php problem procedure query radio random recursion remote script search server sessions smarty sms source space sql stored syntax system table traffic tutorial unicode up-to-date update upload url validation validator variable video web webapplications youtube






