i create a form for update. there are 8 columns in my mysql table. on my main page all the data is retrieve from db and displayed on the page. after every row there is a link edit. when user click that link it goes to a form where all the required fields are displayed. the user may only change one column or two. so my question is how we will know in website which column is to be updated. ofcourse we know the column with modified value will have to be change in db but how we can implement this in php.
my code is my form which is a long one
Code: [Select]<form name="form1" method="post" action="jobsReview.php">
<p align="left">Fill the Following Form</p>
<table width="702" height="486" border="0">
<tr>
<td width="315" height="24"><div align="left">Job Title:</div></td>
<td width="377"><select name="title" id="title">
<option value="Computer Lecturer">Computer Lecturer</option>
<option value="Management Lecturer">Management Lecturer</option>
<option value="English Lecturer">English Lecturer</option>
<option value="Islamyat Lecturer">Islamyat Lecturer</option>
<option value="Electronics Lecturer">Electronics Lecturer</option>
<option value="Economics Lecturer">Economics Lecturer</option>
<option value="Mathematics Lecturer">Mathematics Lecturer</option>
</select></td>
</tr>
<tr>
<td height="26"><div align="left">University:</div></td>
<td><label>
<input type="text" name="university" id="university">
</label></td>
</tr>
<tr>
<td height="24"><div align="left">Minimum Education Required:</div></td>
<td><label>
<input type="text" name="education" id="education">
</label></td>
</tr>
<tr>
<td height="24"><div align="left">Experience Required:</div></td>
<td><label>
<input type="text" name="req_experience" id="req_experience">
</label></td>
</tr>
<tr>
<td height="21">Post On:</td>
<td><select name="day" id="day">
<?php while( $row = mysql_fetch_array($resultday) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['day']; ?></option>
<?php } ?>
</select>
-
<select name="month" id="month">
<?php while( $row = mysql_fetch_array($resultmonth) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['month']; ?></option>
<?php } ?>
</select>
-
<select name="year" id="year">
<?php while( $row = mysql_fetch_array($resultyear) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['year']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td height="21">Apply By:</td>
<td><select name="days" id="days">
<?php while( $row = mysql_fetch_array($resultdays) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['day']; ?></option>
<?php } ?>
</select>
-
<select name="months" id="months">
<?php while( $row = mysql_fetch_array($resultmonths) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['month']; ?></option>
<?php } ?>
</select>
-
<select name="years" id="years">
<?php while( $row = mysql_fetch_array($resultyears) ) { ?>
<option value="<?php echo $row['id']; ?>"><?php echo $row['year']; ?></option>
<?php } ?>
</select></td>
</tr>
<tr>
<td height="325" valign="top"><div align="left">Job Description:</div></td>
<td valign="top"><label>
<textarea name="description" id="description" cols="60" rows="20"></textarea>
</label></td>
</tr>
<tr>
<td height="26"> </td>
<td><input type="submit" name="submit" id="button" value="Edit Job"></td>
</tr>
</table>
<p> </p>
</form>
and here is my php
Code: [Select]<?php
if(isset($_POST['submit']))
{
$id = $_GET["id"];
$db = mysql_connect("localhost");
mysql_select_db("jobolicious", $db);
$quizquery = "UPDATE jobs_uni SET column='{$data}' WHERE id='{$id}'" or die(mysql_error());
//echo $query;
$result = mysql_query($query) or die(mysql_error());
}
?>
preg-match with a string and numbers
Hi, I can't get the expression to work for my preg_match, what I'd like is for it to match the string, but only if it is accompanied by a letter, not a number. So if a string was found with a number
Unable to display contents in Second Drop Down Box
Hi All, What I am trying to do is 2 dependent drop down boxes and when user selects submit button the values are to be passed to the database to run a insert query. Right now, I am stuck
Dump with added_funcion cl_salv_table
Hi there, I'm having some troubles adding a self defined function to an ALV in fullscreen. The thing is that I'm getting a dump after I press de button of my added function; the exception is
read integers that returns a negative or prints the average
Im trying to finish this homework assignment by tommarow afternoon and I keep getting stuck.
if php cookie set, show code...
Hi all.. I need to figure out this little snippet right quick.. seems like it should be easy enough to do, but I'm flailing here...I need to have a blurb that checks to see if a cookie of a specific
duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or not. How can I do this ??
need help in update query
hi i have a dynamic form. i need help in how can i use update query when values from dynamic form get pass to php file.currently when i press submit it displays this and does not update fieldsCode:
Post, not working, please help
The error is:Method Not AllowedThe requested method POST is not allowed for the URL /students/06/php/index.--------------------------------------------------------------------------------Apache/1.3.33
simplexml and xpath - Need some help
Hello,I am trying to parse an xml which comes back from Amazon and I am trying to know how many Browsenodes are shown within the XML.I am using the classs Tarzan to get the xml from Amazon and the
how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are two buttons. ob clicking first button i want to save user's provided data to the database display the