Jump to content

HarryAdney

New Members
  • Posts

    4
  • Joined

  • Last visited

HarryAdney's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. All of the other fields have the $ in front, i.e. // Insert record $sql_insert = "INSERT INTO user_mst(role, first_name, last_name, gender, dob, location, city, postcode, country, latitude, longitude, email, password, intel, email_activated, activation_token, d_added, d_updated) VALUES('$role', '$first_name', '$last_name', '$gender', '$dob', '$location', '$city', '$postcode', '$country_list', '$latitude', '$longitude', '$email', '$password', '$intel', '$email_activated', '$activation_token', '$d_added', '$d_updated')"; $result_insert = mysql_query($sql_insert) or die(mysql_error()); $id = mysql_insert_id($conn); I paid a guy on PeoplePerHour to do this code for me as I don't have time to do it myself. I'm learning in my own time but, as I say, I'm spending a lot of time on other projects. the developer who did the code for me appears to gone on holiday, unfortunately, so I'm stuck with trying to get it to work myself.
  2. Hi thanks for getting back to me so quickly. I changed $country = clean($_POST['$selectedOption']); to $country = clean($_POST['$country_list]); and tested, without success. Do I need to change the insert statement too? Something like: $sql_insert = "INSERT INTO user_mst(country) VALUES('$country_list)";
  3. Hi everyone, I'm a complete newbie here. I've looked around for help and tried a few solutions without success, so because time is short I'm asking for help. I have a registration form which includes address details. The form holds a country field which is a listbox, the values being selected from a MySQL table. How do I assign the selected country option to a field list in the insert statement? Here's what I have so far: Registration page form: <div class="form-group"> <input type="text" class="form-control" id="country" name="country" placeholder="Country"> <select name="country_list"> <?php $sql = mysql_query("SELECT country_name FROM countries"); while ($row = mysql_fetch_array($sql)){ echo "<option value=\"country_list\">" . $row['country_name'] . "</option>"; } ?> </select> </div> The insert function page: switch ($action) { case 'signup': switch ($action) { case 'signup': $country = clean($_POST['$selectedOption']); etc. The insert statement: $sql_insert = "INSERT INTO user_mst(country) VALUES('$country_name)"; $result_insert = mysql_query($sql_insert) or die(mysql_error()); $id = mysql_insert_id($conn); In the code sections above, I've removed some of the other fields etc. to focus on the one bit I don't know howto fix. Thanks in advance for any help.
×
×
  • 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.