Jump to content

itgranny

Members
  • Content Count

    20
  • Joined

  • Last visited

Community Reputation

0 Neutral

About itgranny

  • Rank
    Member
  1. I have a mysql table where the columns are id, name, username and password. I have it working so that names are in the dropdown, its its posting it, but is there a way to make it display the name, yet post the id? The following is what I have done, it works, but the id is just a number and means nothing to the user. When I trade that out for name, the user is able to read and understand it, but some of the names have spaces, punctuation ect, and I would like to have it to be able to look up the username and password once the main table is to be updated. $sql = "SELECT * FROM stud ORDER BY studName"; $result = mysql_query($sql); echo "<td> <select name='id'>"; while ($row = mysql_fetch_array($result)) { echo "<option style='text-transform: uppercase;'" . $row['id'] . "'id='dropdown' >" . $row['id'] . "</option>"; } echo "</select></td></tr>"; echo "<tr><td><input id='submit' name='submit' type='submit' value='Submit'></td></tr></table> </form>"; basically what I want is this but I can't get this to work. $sql = "SELECT * FROM stud ORDER BY studName"; $result = mysql_query($sql); echo "<td> <select name='id'>"; while ($row = mysql_fetch_array($result)) { echo "<option style='text-transform: uppercase;'" . $row['id'] . "'id='dropdown' >" . $row['name'] . "</option>"; } echo "</select></td></tr>"; echo "<tr><td><input id='submit' name='submit' type='submit' value='Submit'></td></tr></table> </form>";
  2. So is it Ajax that you get the username right away from the form or are you saying I need to put an addional dropdown that they have to fill out?
  3. I have 2 tables. One with site names and usernames, the other with data that needs to be entered from a form. The form has a dropdown list of the site names for the user to fill out. What I would like is for the form to automatically get the username and place it in the data table also, automatically. ID siteName userName 1 Site 1 site1 2 Site 2 site2 3 Site3 site3 Form has dropdown is populated with siteName from the site table. User picks one (along with other data but that's working). Submit Posted to insert page Insert page sees the siteName I want it to go to into site table and look for whatever site they chose and figure out what the userName it insert it into the username place in the data table that the form is updating. How would I go about doing this? I've tried a bunch of different ways but keep getting errors.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.