Note that there are some explanatory texts on larger screens.

plurals
  1. POI'm trying to make update process page for my eprofile web
    text
    copied!<p>This is what im trying to do.. i got eprofile with a database. the database consist of 2 table which is personal_data and and nationality. 1st user can view thier old personal information then i gonna make update/edit page for them. Nationality is in other table because the nationality in dropdown menu. then the user can change thier personal and information, after they insert new information they clicking the submit button and go to process.php where update process for database occur. my problem is, i dont know how to define/or how to connect two table which is personal_data and nationality in the update query.</p> <p>code for nationality</p> <pre><code> &lt;?php $query = "SELECT nationality_type FROM nationality"; $result = mysql_query ($query); ?&gt; &lt;select name="personal_nationality" &gt; &lt;?php while($row = mysql_fetch_array($result)){ ?&gt; &lt;option value="&lt;?php echo $row['nationality_type']?&gt;" &lt;?php if ( $personal_nationality == $row['nationality_type']){ ?&gt; selected &lt;?php } ?&gt;&gt; &lt;?php echo $row['nationality_type']?&gt;&lt;/option&gt; &lt;?php }?&gt; &lt;/select&gt; </code></pre> <p>process.php code</p> <pre><code> &lt;?php $host="localhost"; // test local $username="lasadmin"; // Mysql username $password="lasadmin"; // Mysql password $db_name="eprofile"; // Database name $db = mysql_connect($host, $username, $password); $link = mysql_select_db($db_name,$db); $personal_designation = $_POST['personal_designation']; $personal_department = $_POST['personal_department']; $personal_job_grade = $_POST['personal_job_grade']; $personal_emp_group = $_POST['personal_emp_group']; $personal_current_company = $_POST['personal_current_company']; $personal_work_location = $_POST['personal_work_location']; mysql_query("UPDATE personal_data SET personal_designation = '".mysql_real_escape_string($_POST["personal_designation"])."', personal_department = '".mysql_real_escape_string($_POST["personal_department"])."', personal_job_grade = '".mysql_real_escape_string($_POST["personal_job_grade"])."', personal_emp_group = '".mysql_real_escape_string($_POST["personal_emp_group"])."', personal_current_company = '".mysql_real_escape_string($_POST["personal_current_company"])."', personal_work_location = '".mysql_real_escape_string($_POST["personal_work_location"])."' WHERE LAS_login_id = '".mysql_real_escape_string($_POST["LAS_login_id"])."'"); $personal_full_name = $_POST['personal_full_name']; $personal_title = $_POST['personal_title']; $personal_date_birth = $_POST['personal_date_birth']; $personal_marital_status = $_POST['personal_marital_status']; $personal_nationality = $_POST['nationality_type']; mysql_query("UPDATE personal_data SET personal_full_name = '".mysql_real_escape_string($_POST["personal_full_name"])."', personal_title = '".mysql_real_escape_string($_POST["personal_title"])."', personal_date_birth = '".mysql_real_escape_string($_POST["personal_date_birth"])."', personal_marital_status = '".mysql_real_escape_string($_POST["personal_marital_status"])."', nationality_type = '".mysql_real_escape_string($_POST["personal_nationality"])."' WHERE LAS_login_id = '".mysql_real_escape_string($_POST["LAS_login_id"])."'"); ?&gt; </code></pre> <p>when i trying to change the information(testing), this error is show -Notice: Undefined index: nationality_type in C:\wamp\www\eprofile\process.php on line 26</p> <p>this is code for line 26</p> <pre><code>$personal_nationality = $_POST['nationality_type']; </code></pre> <p>can u tell me what is the problem, and what is the solution for this problem? what should i do on defined index??</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload