Jump to content

Recommended Posts

guys,

 

i have a problem on my drop down list.

 

i have a drop down list dor a drop menu named 'date_updated'

and it is in my updateform page

the current value is being taken from the database

 

my problem is, you can see the curren value from the drop down list

but if you dont modify or select a new item from the drop down

and just submit the current date_updated that is displayed

 

the date_updated will be set to nothing.

meaning if i checked my database, the value for the date_updated field

is blank

which, the current value should still be there since i didnt change anything to it

below is my codes for this form

 

						<select name="dayposted">
					<option value="<? echo "$day_posted";?>" selected><? echo "$day_posted";?></option>
                            <option value='1'>1</option>
                            <option value='2'>2</option>
                            <option value='3'>3</option>
                            <option value='4'>4</option>
                            <option value='5'>5</option>
                            <option value='6'>6</option>
                            <option value='7'>7</option>
                            <option value='8'>8</option>
                            <option value='9'>9</option>
                            <option value='10'>10</option>
                            <option value='11'>11</option>
                            <option value='12'>12</option>
                            <option value='13'>13</option>
                            <option value='14'>14</option>
                            <option value='15'>15</option>
                            <option value='16'>16</option>
                            <option value='17'>17</option>
                            <option value='18'>18</option>
                            <option value='19'>19</option>
                            <option value='20'>20</option>
                            <option value='21'>21</option>
                            <option value='22'>22</option>
                            <option value='23'>23</option>
                            <option value='24'>24</option>
                            <option value='25'>25</option>
                            <option value='26'>26</option>
                            <option value='27'>27</option>
                            <option value='28'>28</option>
                            <option value='29'>29</option>
                            <option value='30'>30</option>
                            <option value='31'>31</option>
                        </select>

 

and this is the code for my query

<? 
include 'db_connect.php';
$query = mysql_query("SELECT staff_created, j_position, c_name, cperson, specialization, level, industry, c_description, j_requirements, j_responsibilities, j_type, salary, location, DAY(date_posted), MONTH(date_posted), DATE_FORMAT(date_posted,'%b'), YEAR(date_posted), DAY(date_closed), MONTH(date_closed), DATE_FORMAT(date_closed,'%b'), YEAR(date_closed), j_status, remarks FROM job_ads WHERE jobid= '$jobid'") or die(mysql_error()); 
$row = mysql_fetch_array( $query );
$staff_created = $row["staff_created"];
$j_position = $row["j_position"];
$c_name = $row["c_name"];
$cperson = $row["c_name"];
$specialization  = $row["specialization"];
$level = $row["level"];
$industry = $row["industry"];
$c_description = $row["c_description"];
$j_requirements = $row["j_requirements"];
$j_responsibilities = $row["j_responsibilities"];
$j_type = $row["j_type"];
$salary = $row["salary"];
$location = $row["location"];
$day_posted = $row["DAY(date_posted)"];
$month_posted = $row["MONTH(date_posted)"];
$month_posted1 = $row["DATE_FORMAT(date_posted,'%b')"];
$year_posted = $row["YEAR(date_posted)"];
$day_closed = $row["DAY(date_closed)"];
$month_closed = $row["MONTH(date_closed)"];
$month_closed1 = $row["DATE_FORMAT(date_closed,'%b')"];
$year_closed = $row["YEAR(date_closed)"];
$j_status = $row["j_status"];
$remarks = $row["remarks"];
?>

 

 

hope you could help me with this.

 

thanks!

Link to comment
https://forums.phpfreaks.com/topic/39989-problem-on-drop-down-list/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.