User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 425,950 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 1,574 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

trying to make a survey for school yearbook, need help

Join Date: Dec 2007
Posts: 59
Reputation: dani190 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dani190 dani190 is offline Offline
Junior Poster in Training

Re: trying to make a survey for school yearbook, need help

  #8  
Jan 10th, 2008
Originally Posted by nav33n View Post
If you have these 300 students info in a table, then just fetch their info by using loops. Say, for example, you have student table with their info. You get the dropdown by doing something like this.
  1. <?php
  2. $conn=mysql_connect($host,$username,$pass);
  3. mysql_select_db($dbname);
  4. $query="select student_name from student";
  5. $result=mysql_query($query);
  6. echo "<select name=\"student_name\">";
  7. while($row=mysql_fetch_array($result)){
  8. echo "<option value=".$row['student_name'].">".$row['student_name']."</option>";
  9. }
  10. ....

This will put all the student names in the select box.


30 questions ? What 30 questions ? About your second question, yes, you can write a function and whenever you need values from the table, you can call that function.



If you want to submit the user's input to a table, you do it using an insert statement. When the user submits the page, the form variables are accessed as $_POST['variable_name'] or $_GET['variable_name'] depending upon the method you want.



You will find a lot of scripts on the net to generate random password. If you want a simplest random password generator, have an array of alphanumerics. (a-z A-Z 0-9). Generate a random number and fetch that array element.

Cheers,
Nav


Ok so about this i made the table and entered all the data. Its in a table called grads and there are rows called user_id. I want to retrieve user_id for the drop down menu.

also how do i now generate random passwords for everyone? I made a field called password in the mysql just i don't know how to generate the random password
Reply With Quote  
All times are GMT -4. The time now is 10:14 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC