Filling in form for users

Reply

Join Date: Jul 2005
Posts: 11
Reputation: lawfour is an unknown quantity at this point 
Solved Threads: 0
lawfour lawfour is offline Offline
Newbie Poster

Filling in form for users

 
0
  #1
Nov 23rd, 2006
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
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Filling in form for users

 
0
  #2
Nov 24th, 2006
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?
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!
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 11
Reputation: lawfour is an unknown quantity at this point 
Solved Threads: 0
lawfour lawfour is offline Offline
Newbie Poster

Re: Filling in form for users

 
0
  #3
Nov 24th, 2006
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:-)
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Filling in form for users

 
0
  #4
Nov 24th, 2006
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..
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!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC