close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

update mysql form select value

Thread began 4/21/2018 11:46 am by anonymous | Last modified 4/23/2018 12:53 pm by anonymous | 264 views | 1 replies


update mysql form select value

i want update data mysql to select value
just no update?
please help me?

$sql=("SELECT * FROM dars

major like '%$major%'
and sal like '%$sal%'
and type2 like '%$type2%'
and type like '%$type%'
and title like '$title%'
and vahed like '%$vahed%'
and nimsal like '%$nimsal%'");
if (mysql_num_rows($result) > 0)

<form method="post" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>">

echo $n++ . " ----- " //. " darsid: "?>
<input type="hidden" name="darsid[]" value="<?php $row['darsid']; ?>"/>

sal : <select name="sal[]">
<option value="اول دبیرستان"<?php if($row['sal']=='اول دبیرستان') echo 'selected="selected"'; ?>>اول دبیرستان </option>
<option value="دوم دبیرستان"<?php if($row['sal']=='دوم دبیرستان') echo 'selected="selected"'; ?>>دوم دبیرستان </option>
<option value="سوم دبیرستان"<?php if($row['sal']=='سوم دبیرستان') echo 'selected="selected"'; ?>>سوم دبیرستان </option>
major : <select name="major[]">
<option value="کامپیوتر"<?php if($row['major']=='کامپیوتر') echo 'selected="selected"'; ?>>کامپیوتر </option>
<option value="حسابداری"<?php if($row['major']=="حسابداری")echo 'selected="selected"'; ?>>حسابداری </option>
<option value="برق"<?php if($row['major']=='برق') echo 'selected="selected"'; ?>>برق </option>
type2: <select name="type2[]">
<option value="عمومی"<?php if($row['type2']=='عمومی') echo 'selected="selected"'; ?>>عمومی </option>
<option value="تخصصی"<?php if($row['type2']=='تخصصی') echo 'selected="selected"'; ?>> تخصصی</option>
type: <select name="type[]">
<option value="تئوری"<?php if($row['type']=='تئوری') echo 'selected="selected"'; ?>>تئوری </option>
<option value="عملی"<?php if($row['type']=='عملی') echo 'selected="selected"'; ?>> عملی</option>
title: <input type="text" name="title[]" value="<?php echo $row['title']; ?>"/>
vahed: <select name="vahed[]">
<option value="1"<?php if($row['vahed']=='1') echo 'selected="selected"'; ?>>1</option>
<option value="2"<?php if($row['vahed']=='2') echo 'selected="selected"'; ?>>2 </option>
<option value="3"<?php if($row['vahed']=='3') echo 'selected="selected"'; ?>>3 </option>
<option value="4"<?php if($row['vahed']=='4') echo 'selected="selected"'; ?>>4 </option>
nimsal <select name="nimsal[]">
<option value="1"<?php if($row['nimsal']=='1') echo 'selected="selected"'; ?>>نیمسال اول</option>
<option value="2"<?php if($row['nimsal']=='2') echo 'selected="selected"'; ?>>نیمسال دوم </option>
<option value="3"<?php if($row['nimsal']=='3') echo 'selected="selected"'; ?>>کامل </option>


echo "<br>";


<input type="submit" name="edit" value="edit">


$size = count($_POST['darsid']);
$i = 0;
while ($i < $size) {

$sql2="Update dars set
Where darsid='$id1'";

mysql_query($sql2) or die ("Error in query: $query");


Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...