Simon wrote:
 >>What do you mean with "update more "same" fields at the same time"?Can
 >>you give us an example?
 >>
 >>Gvre
 >>
 >
 >
 > <form name="form1" method="post" action="">
 >
 > <?
 >
 > $query1 = "SELECT * FROM table where subcat = $_GET[a]";
 >
 > $result1 = mysql_query($query1);
 >
 > while($row = mysql_fetch_object($result1))
 >
 > {
 >
 > ?>
 >
 > <p>
 >
 > <input name="textfield" type="text" value="<? echo $row->oid; ?>">
 >
 > <input name="textfield1" type="text" value="<? echo $row->url; ?>">
 >
 > </p>
 >
 > <?
 >
 > }
 >
 > ?>
 >
 > <p>
 >
 > <input type="submit" name="Submit" value="Submit">
 >
 > </p>
 >
 > </form>
 >
 > now i want to change values of texfields and update them back to mysql.
 >
If you want to update all the records that have subcat = $_GET[a] with
the same values then you can do somethink like this:

$subcat = $_POST['a'];
$qsubcat = $_POST['subcat'];

"update tables set
field1=$_POST['textfield'],field2='$_POST['textfield1']'  where
subcat='$qsubcat'"

I don 't know if this query will execute correctly because i don 't know
the datatypes of your table fields.
I prefer writing update and insert php scripts independed from select
pages.It 's easier to read.




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to