Return-Path: <php-db-return-30376-robert=seabreeze.asn.au@lists.php.net>
Envelope-To: robert@seabreeze.asn.au
X-Spam-Status: SpamAssassin Failed
Received: from pb1.pair.com ([216.92.131.4] verified)
  by hermajestystheatre.com.au (CommuniGate Pro SMTP 4.1.3)
  with SMTP id 335994 for robert@seabreeze.asn.au; Sat, 06 Sep 2003 05:57:40 +1000
Received: (qmail 99389 invoked by uid 1010); 5 Sep 2003 20:01:53 -0000
Mailing-List: contact php-db-help@lists.php.net; run by ezmlm
Precedence: bulk
list-help: <mailto:php-db-help@lists.php.net>
list-unsubscribe: <mailto:php-db-unsubscribe@lists.php.net>
list-post: <mailto:php-db@lists.php.net>
Delivered-To: mailing list php-db@lists.php.net
Received: (qmail 99376 invoked by uid 1010); 5 Sep 2003 20:01:53 -0000
Delivered-To: ezmlm-scan-php-db@lists.php.net
Delivered-To: ezmlm-php-db@lists.php.net
MIME-Version: 1.0
Message-Id: <3F58EB4F.000001.02176@fsoto1>
Date: Fri, 5 Sep 2003 14:00:15 -0600 (Mountain Daylight Time)
Content-Type: Multipart/related;
  type="multipart/alternative";
  boundary="------------Boundary-00=_FKBRQL80000000000000"
X-Mailer: IncrediMail 2001 (2001155.2001155)
From: "Fernando Soto" <fsoto@ocaso.com.mx>
References: <20030905191517.34160.qmail@pb1.pair.com>
X-FID: FLAVOR00-NONE-0000-0000-000000000000
X-FVER: 
X-CNT: ;
X-Priority: 3
To: <jroth1@telus.net>, <php-db@lists.php.net>
Subject: Re: [PHP-DB] Modify MySQL Record

--------------Boundary-00=_FKBRQL80000000000000
Content-Type: Multipart/Alternative;
  boundary="------------Boundary-00=_GKBRLVC0000000000000"


--------------Boundary-00=_GKBRLVC0000000000000
Content-Type: Text/Plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

When you have an auntoincremente field in your table, you don't have to
especify the field name in the query, as the following:=0D
 =0D
 =0D
$query =3D "INSERT INTO cnrl_db (kwo, lsd, date, well, field, uni,=0D
license, formation, perfs, event, fluid, mode, type, vhd, file, kb, grd,=0D
open, sour, tube, landed, casing, landed2, shut_date, shut_time, pres, ta=
g)=0D
VALUES ('$kwo', '$lsd', '$date', '$well', '$field', '$uni',=0D
'$license', '$formation', '$perfs', '$event', '$fluid', '$mode', '$type',=
=0D
'$vhd', '$file', '$kb', '$grd', '$open', '$sour', '$tube', '$landed',=0D
'$casing', '$landed2', '$shut_date', '$shut_time', '$pres', '$tag')";=0D
=0D
hope it helps=0D
eLFeR.....=0D
=0D
-------Original Message-------=0D
 =0D
From: Jeff=0D
Date: Viernes, 05 de Septiembre de 2003 01:15:21 p.m.=0D
To: php-db@lists.php.net=0D
Subject: Re: [PHP-DB] Modify MySQL Record=0D
 =0D
Ok, so I added what you suggested, but it still doesn't assign any number=
s=0D
to the records.=0D
 =0D
$query =3D "INSERT INTO cnrl_db (gradient, kwo, lsd, date, well, field, u=
ni,=0D
license, formation, perfs, event, fluid, mode, type, vhd, file, kb, grd,=0D
open, sour, tube, landed, casing, landed2, shut_date, shut_time, pres, ta=
g)=0D
VALUES ('NULL', '$kwo', '$lsd', '$date', '$well', '$field', '$uni',=0D
'$license', '$formation', '$perfs', '$event', '$fluid', '$mode', '$type',=
=0D
'$vhd', '$file', '$kb', '$grd', '$open', '$sour', '$tube', '$landed',=0D
'$casing', '$landed2', '$shut_date', '$shut_time', '$pres', '$tag')";=0D
     $result =3D mysql_query($query, $link_id) OR die(mysql_error());=0D
 =0D
gradient - the auto increment field.=0D
 =0D
 =0D
 =0D
"Richard Hutchins" <Richard.Hutchins@Getingeusa.com> wrote in message=0D
news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B8@USROCEXC...=0D
> Jeff,=0D
>=0D
> When you want to increment an autoincrement field, you just put NULL in=
to=0D
> the query. For example:=0D
>=0D
> INSERT (NULL,'Jeff','php list','Modify MySQL Record') INTO mail;=0D
>=0D
> Where NULL is in the same spot in the field list as your autoincrement=0D
> field.=0D
>=0D
> That concept is covered in the MySQL manual. Pretty simple stuff. If=0D
you're=0D
> in a situation where you have an autoincrement field that you sometimes=
=0D
> autoincrement and sometimes manually assign a value to, I think you're=0D
> misusing the autoincrement field (IMHO). If you have that situation, us=
e=0D
the=0D
> autoincrement field to assign a unique ID to the table row and use a=0D
> separate field with another name for the manually assigned data.=0D
>=0D
> As far as the stuff you mentioned about clicking things and getting the=
=0D
> messages you expected, I'm kinda' lost. But if you use the autoincremen=
t=0D
> field as it is intended, the logic should present itself.=0D
>=0D
> > -----Original Message-----=0D
> > From: Jeff [mailto:jroth1@telus.net]=0D
> > Sent: Friday, September 05, 2003 2:07 PM=0D
> > To: php-db@lists.php.net=0D
> > Subject: Re: [PHP-DB] Modify MySQL Record=0D
> >=0D
> >=0D
> > Ok, so it sorta works now *grin*=0D
> >=0D
> > Two new problems=0D
> >=0D
> > I added an auto increment field in my table and changed the=0D
> > php to reflect=0D
> > that field - But for some reason, it doesn't work..=0D
> > When I submit a new record, do I need to tell SQL to add one to the=0D
> > greatest, or should it do it automatically when a new record=0D
> > is created?=0D
> > gradient MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT,=0D
> > and I made it the primary.=0D
> >=0D
> > Problem two,=0D
> >=0D
> > If I manually enter a number into that field, I can make=0D
> > changes to the=0D
> > record no problem! but... it goes into some kind of=0D
> > continuous loop. It=0D
> > comes up with a window that says what I told it to say --=0D
> > user_message("All=0D
> > records regarding $kwo have been changed!",=0D
> >=0D
> > "$PHP_SELF?action=3Dview_record&gradient=3D$new_gradient"); --=0D
> > I hit OK and it jumps to -- if(empty($kwo)) error_message('Empty=0D
> > Gradient!!'); -- if you hit ok again, it just loops.=0D
> >=0D
> > This might be solved as soon as I get that one field to auto=0D
> > populate. :P=0D
> >=0D
> >=0D
> > "Richard Hutchins" <Richard.Hutchins@Getingeusa.com> wrote in message=
=0D
> > news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B2@USROCEXC...=0D
> > > Jeff,=0D
> > >=0D
> > > No problem. Happens to everyone, trust me.=0D
> > >=0D
> > > Anyway, I see you're using mysql_affected_rows($link_id) to=0D
> > get see how=0D
> > many=0D
> > > rows were affected by the UPDATE. Try getting rid of the=0D
> > $link_id in the=0D
> > > declaration and just use mysql_affected_rows(). Personally,=0D
> > I have always=0D
> > > had trouble when specifying a resource in a mysql function=0D
> > like this (it's=0D
> > > probably just me). But, the mysql_affected_rows() function will, by=
=0D
> > default,=0D
> > > use the last connection used by your script.=0D
> > >=0D
> > > Also, you're checking to see if it's not set e.g.,:=0D
> > >=0D
> > > > > > > $num_rows =3D mysql_affected_rows($link_id);=0D
> > > > > > > if(!$num_rows) error_message("Nothing changed!");=0D
> > >=0D
> > > According to the documentation, mysql_affected_rows()=0D
> > returns a -1 if the=0D
> > > query failed. And I'm pretty sure it returns 0 if your query was=0D
> > successful=0D
> > > but didn't affect any rows. I'm pretty sure ! checks for=0D
> > FALSE which is=0D
> > not=0D
> > > one of mysql_affected_rows() valid return values. So your=0D
> > check isn't=0D
> > doing=0D
> > > what you think it should.=0D
> > >=0D
> > > Give that a shot and see if it helps out at all.=0D
> > >=0D
> > > Good luck.=0D
> > >=0D
> > > Rich=0D
> > >=0D
> > > > -----Original Message-----=0D
> > > > From: Jeff [mailto:jroth1@telus.net]=0D
> > > > Sent: Friday, September 05, 2003 12:44 PM=0D
> > > > To: php-db@lists.php.net=0D
> > > > Subject: Re: [PHP-DB] Modify MySQL Record=0D
> > > >=0D
> > > >=0D
> > > > K, my tired eyes last night missed a few stupid mistakes...=0D
> > > >=0D
> > > > First: The Commas=0D
> > > > Second: I removed the period form the first line of the array=0D
> > > > -- $field_str=0D
> > > > =3D " kwo =3D '$kwo', ";=0D
> > > > Third: two typos.=0D
> > > >=0D
> > > > *hangs head in shame*=0D
> > > >=0D
> > > > Sorry for bothering everyone. :P=0D
> > > >=0D
> > > > BUT! I'm still having a problem - when I try to submit the=0D
> > > > change it comes=0D
> > > > back and says "Nothing Changed!" even if I change every field.=0D
> > > >=0D
> > > > Gonna do some more hunting - I'm doubting myself now. ;)=0D
> > > >=0D
> > > >=0D
> > > >=0D
> > > >=0D
> > > > "Richard Hutchins" <Richard.Hutchins@Getingeusa.com>=0D
> > wrote in message=0D
> > > > news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B1@USROCEXC...=0D
> > > > > I'd suggest you first output your SQL statement to the=0D
> > > > browser to see=0D
> > > > > exactly what it's sending to the database. Might give you=0D
> > > > the answer right=0D
> > > > > there.=0D
> > > > >=0D
> > > > > > -----Original Message-----=0D
> > > > > > From: Jeff [mailto:jroth1@telus.net]=0D
> > > > > > Sent: Friday, September 05, 2003 12:35 PM=0D
> > > > > > To: php-db@lists.php.net=0D
> > > > > > Subject: Re: [PHP-DB] Modify MySQL Record=0D
> > > > > >=0D
> > > > > >=0D
> > > > > > Yah, I noticed that after I had submitted this, and fixed it=0D
> > > > > > - still no=0D
> > > > > > change - gives the same exact error.=0D
> > > > > >=0D
> > > > > > "Jeffrey N Dyke" <jeffrey_n_Dyke@Keane.com> wrote in message=0D
> > > > > > news:OFFEE2B14B.9BAC564B-ON85256D98.005AAEE6@keane.com...=0D
> > > > > > >=0D
> > > > > > > looks like you stopped putting commas after your fields at=0D
> > > > > > > $field_str .=3D " formation =3D '$formation' ";=0D
> > > > > > > $field_str .=3D " perfs =3D '$perfs' ";=0D
> > > > > > > $field_str .=3D " event =3D '$event' ";=0D
> > > > > > > $field_str .=3D " fluid =3D '$fluid' ";=0D
> > > > > > >=0D
> > > > > > > hth=0D
> > > > > > > Jeff=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > > "Jeff"=0D
> > > > > > > <jroth1@telus.net To:=0D
> > > > > > php-db@lists.php.net=0D
> > > > > > > > cc:=0D
> > > > > > > Subject:=0D
> > > > > > [PHP-DB] Modify=0D
> > > > > > MySQL Record=0D
> > > > > > > 09/05/2003 12:28=0D
> > > > > > > PM=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > > Helloooo!=0D
> > > > > > >=0D
> > > > > > > I'm having a small problem with modifying the data in a=0D
> > > > MySQL DB.=0D
> > > > > > >=0D
> > > > > > > And here's the error:=0D
> > > > > > >=0D
> > > > > > > (After I click the "Submit Changes" button) Error: 1064:=0D
> > > > > > You have an error=0D
> > > > > > > in your SQL syntax near '(10-10-10-10)' kwo=3D'1235',=0D
> > > > > > lsd=3D'10-10-10-10',=0D
> > > > > > > date=3D'2003-05-05', well' at line 1=0D
> > > > > > >=0D
> > > > > > > Here's the code:=0D
> > > > > > >=0D
> > > > > > > function edit_record() {=0D
> > > > > > > global $default_dbname, $gradient_tablename,=0D
> > > > > > $access_log_tablename;=0D
> > > > > > > global $new_lsd, $kwo, $lsd, $date, $well, $field,=0D
> > > > > > > $uni, $license, $formation, $perfs, $event,=0D
> > $fluid, $mode,=0D
> > > > > > > $type, $vhd, $file, $kb, $grd, $open, $sour, $tube,=0D
> > > > > > > $landed, $casing, $landed2, $shut_date, $shut_time,=0D
> > > > $pres, $tag;=0D
> > > > > > >=0D
> > > > > > > if(empty($kwo)) error_message('Empty Gradient!');=0D
> > > > > > >=0D
> > > > > > > $link_id =3D db_connect($default_dbname);=0D
> > > > > > > if(!$link_id) error_message(sql_error());=0D
> > > > > > >=0D
> > > > > > > $field_str =3D '';=0D
> > > > > > > if($kwo !=3D $new_kwo) $field_str =3D " kwo =3D '$new_kwo',=
 ";=0D
> > > > > > > if(!empty($lsd)) {=0D
> > > > > > > $field_str .=3D " lsd =3D other_lsd('$lsd') ";=0D
> > > > > > > }=0D
> > > > > > >=0D
> > > > > > > $field_str .=3D " kwo =3D '$kwo', ";=0D
> > > > > > > $field_str .=3D " lsd =3D '$lsd', ";=0D
> > > > > > > $field_str .=3D " date =3D '$date', ";=0D
> > > > > > > $field_str .=3D " well =3D '$well', ";=0D
> > > > > > > $field_str .=3D " field =3D '$field', ";=0D
> > > > > > > $field_str .=3D " uni =3D '$uni', ";=0D
> > > > > > > $field_str .=3D " license =3D '$license', ";=0D
> > > > > > > $field_str .=3D " formation =3D '$formation' ";=0D
> > > > > > > $field_str .=3D " perfs =3D '$perfs' ";=0D
> > > > > > > $field_str .=3D " event =3D '$event' ";=0D
> > > > > > > $field_str .=3D " fluid =3D '$fluid' ";=0D
> > > > > > > $field_str .=3D " mode =3D '$mode' ";=0D
> > > > > > > $field_str .=3D " type =3D '$type' ";=0D
> > > > > > > $field_str .=3D " vhd =3D '$vhd' ";=0D
> > > > > > > $field_str .=3D " file =3D '$file' ";=0D
> > > > > > > $field_str .=3D " kb =3D '$kb' ";=0D
> > > > > > > $field_str .=3D " grd =3D '$grd' ";=0D
> > > > > > > $field_str .=3D " open =3D '$open' ";=0D
> > > > > > > $field_str .=3D " sour =3D '$open' ";=0D
> > > > > > > $field_str .=3D " tubing =3D '$tubing' ";=0D
> > > > > > > $field_str .=3D " landed =3D '$landed' ";=0D
> > > > > > > $field_str .=3D " casing =3D '$casing' ";=0D
> > > > > > > $field_str .=3D " landed2 =3D '$landed2' ";=0D
> > > > > > > $field_str .=3D " shut_date =3D '$shut_date' ";=0D
> > > > > > > $field_str .=3D " sut_time =3D '$shut_time' ";=0D
> > > > > > > $field_str .=3D " pres =3D '$pres' ";=0D
> > > > > > > $field_str .=3D " tag =3D '$tag' ";=0D
> > > > > > >=0D
> > > > > > >=0D
> > > > > > > $query =3D "UPDATE $gradient_tablename SET $field_str WHERE=
=0D
> > > > > > kwo =3D '$kwo'";=0D
> > > > > > >=0D
> > > > > > > $result =3D mysql_query($query);=0D
> > > > > > > if(!$result) error_message(sql_error());=0D
> > > > > > >=0D
> > > > > > > $num_rows =3D mysql_affected_rows($link_id);=0D
> > > > > > > if(!$num_rows) error_message("Nothing changed!");=0D
> > > > > > > if($lsd !=3D $new_kwo) {=0D
> > > > > > > $query =3D "UPDATE $access_log_tablename SET kwo =3D=0D
> > > > > > '$new_kwo' WHERE kwo=0D
> > > > > > =3D=0D
> > > > > > > '$kwo'";=0D
> > > > > > > $result =3D mysql_query($query);=0D
> > > > > > > if(!$result) error_message(sql_error());=0D
> > > > > > >=0D
> > > > > > > user_message("All records regarding $lsd have been=0D
> > > > changed!",=0D
> > > > > > >=0D
> > "$PHP_SELF?action=3Dview_record&kwo=3D$new_kwo");=0D
> > > > > > > }=0D
> > > > > > > else {=0D
> > > > > > > user_message("All records regarding $lsd have been=0D
> > > > changed!");=0D
> > > > > > > }=0D
> > > > > > > }=0D
> > > > > > >=0D
> > > > > > > --=0D
> > > > > > > PHP Database Mailing List (http://www.php.net/)=0D
> > > > > > > To unsubscribe, visit: http://www.php.net/unsub.php=0D
> > > > > >=0D
> > > > > > --=0D
> > > > > > PHP Database Mailing List (http://www.php.net/)=0D
> > > > > > To unsubscribe, visit: http://www.php.net/unsub.php=0D
> > > > > >=0D
> > > >=0D
> > > > --=0D
> > > > PHP Database Mailing List (http://www.php.net/)=0D
> > > > To unsubscribe, visit: http://www.php.net/unsub.php=0D
> > > >=0D
> >=0D
> > --=0D
> > PHP Database Mailing List (http://www.php.net/)=0D
> > To unsubscribe, visit: http://www.php.net/unsub.php=0D
> >=0D
 =0D
--=0D
PHP Database Mailing List (http://www.php.net/)=0D
To unsubscribe, visit: http://www.php.net/unsub.php=0D
 =0D
 =0D
=2E
--------------Boundary-00=_GKBRLVC0000000000000
Content-Type: Text/HTML;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Diso-8859-=
1">
<META content=3D"IncrediMail 1.0" name=3DGENERATOR>
<!--IncrdiXMLRemarkStart>
<IncrdiX-Info>
<X-FID>FLAVOR00-NONE-0000-0000-000000000000</X-FID>
<X-FVER></X-FVER>
<X-CNT>;</X-CNT>
</IncrdiX-Info>
<IncrdiXMLRemarkEnd-->
</HEAD>
<BODY style=3D"BACKGROUND-POSITION: 0px 0px; FONT-SIZE: 12pt; MARGIN: 5px=
 10px 10px; FONT-FAMILY: Arial" bgColor=3D#ffffff background=3D"" scroll=3D=
yes ORGYPOS=3D"0" X-FVER=3D"3.0">
<TABLE id=3DINCREDIMAINTABLE cellSpacing=3D0 cellPadding=3D2 width=3D"100=
%" border=3D0>
<TBODY>
<TR>
<TD id=3DINCREDITEXTREGION style=3D"FONT-SIZE: 12pt; CURSOR: auto; FONT-F=
AMILY: Arial" width=3D"100%">
<DIV>When you have an auntoincremente field in&nbsp;your table, you don't=
 have to&nbsp;especify the field name in the query,&nbsp;as the following=
:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;
<DIV>$query =3D "INSERT INTO cnrl_db (kwo, lsd, date, well, field, uni,</=
DIV>
<DIV>license, formation, perfs, event, fluid, mode, type, vhd, file, kb, =
grd,</DIV>
<DIV>open, sour, tube, landed, casing, landed2, shut_date, shut_time, pre=
s, tag)</DIV>
<DIV>VALUES ('$kwo', '$lsd', '$date', '$well', '$field', '$uni',</DIV>
<DIV>'$license', '$formation', '$perfs', '$event', '$fluid', '$mode', '$t=
ype',</DIV>
<DIV>'$vhd', '$file', '$kb', '$grd', '$open', '$sour', '$tube', '$landed'=
,</DIV>
<DIV>'$casing', '$landed2', '$shut_date', '$shut_time', '$pres', '$tag')"=
;</DIV>
<DIV>&nbsp;</DIV>
<DIV>hope it helps</DIV>
<DIV>eLFeR.....</DIV>
<DIV>&nbsp;</DIV></DIV>
<DIV id=3DIncrediOriginalMessage><I>-------Original Message-------</I></D=
IV>
<DIV>&nbsp;</DIV>
<DIV id=3Dreceivestrings>
<DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>From:</B></I> <A href=3D"m=
ailto:jroth1@telus.net">Jeff</A></DIV>
<DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>Date:</B></I> Viernes, 05 =
de Septiembre de 2003 01:15:21 p.m.</DIV>
<DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>To:</B></I> <A href=3D"mai=
lto:php-db@lists.php.net">php-db@lists.php.net</A></DIV>
<DIV dir=3Dltr style=3D"FONT-SIZE: 11pt" <i><B>Subject:</B></I> Re: [PHP-=
DB] Modify MySQL Record</DIV></DIV>
<DIV>&nbsp;</DIV>
<DIV>Ok, so I added what you suggested, but it still doesn't assign any n=
umbers</DIV>
<DIV>to the records.</DIV>
<DIV>&nbsp;</DIV>
<DIV>$query =3D "INSERT INTO cnrl_db (gradient, kwo, lsd, date, well, fie=
ld, uni,</DIV>
<DIV>license, formation, perfs, event, fluid, mode, type, vhd, file, kb, =
grd,</DIV>
<DIV>open, sour, tube, landed, casing, landed2, shut_date, shut_time, pre=
s, tag)</DIV>
<DIV>VALUES ('NULL', '$kwo', '$lsd', '$date', '$well', '$field', '$uni',<=
/DIV>
<DIV>'$license', '$formation', '$perfs', '$event', '$fluid', '$mode', '$t=
ype',</DIV>
<DIV>'$vhd', '$file', '$kb', '$grd', '$open', '$sour', '$tube', '$landed'=
,</DIV>
<DIV>'$casing', '$landed2', '$shut_date', '$shut_time', '$pres', '$tag')"=
;</DIV>
<DIV>&nbsp;&nbsp;&nbsp;&nbsp; $result =3D mysql_query($query, $link_id) O=
R die(mysql_error());</DIV>
<DIV>&nbsp;</DIV>
<DIV>gradient - the auto increment field.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>"Richard Hutchins" &lt;<A href=3D"mailto:Richard.Hutchins@Getingeusa=
=2Ecom">Richard.Hutchins@Getingeusa.com</A>&gt; wrote in message</DIV>
<DIV>news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B8@USROCEXC...</DIV>
<DIV>&gt; Jeff,</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; When you want to increment an autoincrement field, you just put=
 NULL into</DIV>
<DIV>&gt; the query. For example:</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; INSERT (NULL,'Jeff','php list','Modify MySQL Record') INTO mail=
;</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; Where NULL is in the same spot in the field list as your autoin=
crement</DIV>
<DIV>&gt; field.</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; That concept is covered in the MySQL manual. Pretty simple stuf=
f. If</DIV>
<DIV>you're</DIV>
<DIV>&gt; in a situation where you have an autoincrement field that you s=
ometimes</DIV>
<DIV>&gt; autoincrement and sometimes manually assign a value to, I think=
 you're</DIV>
<DIV>&gt; misusing the autoincrement field (IMHO). If you have that situa=
tion, use</DIV>
<DIV>the</DIV>
<DIV>&gt; autoincrement field to assign a unique ID to the table row and =
use a</DIV>
<DIV>&gt; separate field with another name for the manually assigned data=
=2E</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; As far as the stuff you mentioned about clicking things and get=
ting the</DIV>
<DIV>&gt; messages you expected, I'm kinda' lost. But if you use the auto=
increment</DIV>
<DIV>&gt; field as it is intended, the logic should present itself.</DIV>
<DIV>&gt;</DIV>
<DIV>&gt; &gt; -----Original Message-----</DIV>
<DIV>&gt; &gt; From: Jeff [<A href=3D"mailto:jroth1@telus.net">mailto:jro=
th1@telus.net</A>]</DIV>
<DIV>&gt; &gt; Sent: Friday, September 05, 2003 2:07 PM</DIV>
<DIV>&gt; &gt; To: <A href=3D"mailto:php-db@lists.php.net">php-db@lists.p=
hp.net</A></DIV>
<DIV>&gt; &gt; Subject: Re: [PHP-DB] Modify MySQL Record</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; Ok, so it sorta works now *grin*</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; Two new problems</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; I added an auto increment field in my table and changed th=
e</DIV>
<DIV>&gt; &gt; php to reflect</DIV>
<DIV>&gt; &gt; that field - But for some reason, it doesn't work..</DIV>
<DIV>&gt; &gt; When I submit a new record, do I need to tell SQL to add o=
ne to the</DIV>
<DIV>&gt; &gt; greatest, or should it do it automatically when a new reco=
rd</DIV>
<DIV>&gt; &gt; is created?</DIV>
<DIV>&gt; &gt; gradient MEDIUMINT(10) DEFAULT '0' NOT NULL AUTO_INCREMENT=
,</DIV>
<DIV>&gt; &gt; and I made it the primary.</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; Problem two,</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; If I manually enter a number into that field, I can make</=
DIV>
<DIV>&gt; &gt; changes to the</DIV>
<DIV>&gt; &gt; record no problem! but... it goes into some kind of</DIV>
<DIV>&gt; &gt; continuous loop. It</DIV>
<DIV>&gt; &gt; comes up with a window that says what I told it to say --<=
/DIV>
<DIV>&gt; &gt; user_message("All</DIV>
<DIV>&gt; &gt; records regarding $kwo have been changed!",</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; "$PHP_SELF?action=3Dview_record&amp;gradient=3D$new_gradie=
nt"); --</DIV>
<DIV>&gt; &gt; I hit OK and it jumps to -- if(empty($kwo)) error_message(=
'Empty</DIV>
<DIV>&gt; &gt; Gradient!!'); -- if you hit ok again, it just loops.</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; This might be solved as soon as I get that one field to au=
to</DIV>
<DIV>&gt; &gt; populate. :P</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; "Richard Hutchins" &lt;<A href=3D"mailto:Richard.Hutchins@=
Getingeusa.com">Richard.Hutchins@Getingeusa.com</A>&gt; wrote in message<=
/DIV>
<DIV>&gt; &gt; news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B2@USROCEXC...<=
/DIV>
<DIV>&gt; &gt; &gt; Jeff,</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; No problem. Happens to everyone, trust me.</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; Anyway, I see you're using mysql_affected_rows($link_=
id) to</DIV>
<DIV>&gt; &gt; get see how</DIV>
<DIV>&gt; &gt; many</DIV>
<DIV>&gt; &gt; &gt; rows were affected by the UPDATE. Try getting rid of =
the</DIV>
<DIV>&gt; &gt; $link_id in the</DIV>
<DIV>&gt; &gt; &gt; declaration and just use mysql_affected_rows(). Perso=
nally,</DIV>
<DIV>&gt; &gt; I have always</DIV>
<DIV>&gt; &gt; &gt; had trouble when specifying a resource in a mysql fun=
ction</DIV>
<DIV>&gt; &gt; like this (it's</DIV>
<DIV>&gt; &gt; &gt; probably just me). But, the mysql_affected_rows() fun=
ction will, by</DIV>
<DIV>&gt; &gt; default,</DIV>
<DIV>&gt; &gt; &gt; use the last connection used by your script.</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; Also, you're checking to see if it's not set e.g.,:</=
DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $num_rows =3D mysql_affected_rows=
($link_id);</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!$num_rows) error_message("Not=
hing changed!");</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; According to the documentation, mysql_affected_rows()=
</DIV>
<DIV>&gt; &gt; returns a -1 if the</DIV>
<DIV>&gt; &gt; &gt; query failed. And I'm pretty sure it returns 0 if you=
r query was</DIV>
<DIV>&gt; &gt; successful</DIV>
<DIV>&gt; &gt; &gt; but didn't affect any rows. I'm pretty sure ! checks =
for</DIV>
<DIV>&gt; &gt; FALSE which is</DIV>
<DIV>&gt; &gt; not</DIV>
<DIV>&gt; &gt; &gt; one of mysql_affected_rows() valid return values. So =
your</DIV>
<DIV>&gt; &gt; check isn't</DIV>
<DIV>&gt; &gt; doing</DIV>
<DIV>&gt; &gt; &gt; what you think it should.</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; Give that a shot and see if it helps out at all.</DIV=
>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; Good luck.</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; Rich</DIV>
<DIV>&gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; -----Original Message-----</DIV>
<DIV>&gt; &gt; &gt; &gt; From: Jeff [<A href=3D"mailto:jroth1@telus.net">=
mailto:jroth1@telus.net</A>]</DIV>
<DIV>&gt; &gt; &gt; &gt; Sent: Friday, September 05, 2003 12:44 PM</DIV>
<DIV>&gt; &gt; &gt; &gt; To: <A href=3D"mailto:php-db@lists.php.net">php-=
db@lists.php.net</A></DIV>
<DIV>&gt; &gt; &gt; &gt; Subject: Re: [PHP-DB] Modify MySQL Record</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; K, my tired eyes last night missed a few stupid =
mistakes...</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; First: The Commas</DIV>
<DIV>&gt; &gt; &gt; &gt; Second: I removed the period form the first line=
 of the array</DIV>
<DIV>&gt; &gt; &gt; &gt; -- $field_str</DIV>
<DIV>&gt; &gt; &gt; &gt; =3D " kwo =3D '$kwo', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; Third: two typos.</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; *hangs head in shame*</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; Sorry for bothering everyone. :P</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; BUT! I'm still having a problem - when I try to =
submit the</DIV>
<DIV>&gt; &gt; &gt; &gt; change it comes</DIV>
<DIV>&gt; &gt; &gt; &gt; back and says "Nothing Changed!" even if I chang=
e every field.</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; Gonna do some more hunting - I'm doubting myself=
 now. ;)</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; "Richard Hutchins" &lt;<A href=3D"mailto:Richard=
=2EHutchins@Getingeusa.com">Richard.Hutchins@Getingeusa.com</A>&gt;</DIV>
<DIV>&gt; &gt; wrote in message</DIV>
<DIV>&gt; &gt; &gt; &gt; news:1EA7D3AE70ACD511BE6D006097A78C1E033C92B1@US=
ROCEXC...</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; I'd suggest you first output your SQL state=
ment to the</DIV>
<DIV>&gt; &gt; &gt; &gt; browser to see</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; exactly what it's sending to the database. =
Might give you</DIV>
<DIV>&gt; &gt; &gt; &gt; the answer right</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; there.</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; -----Original Message-----</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; From: Jeff [<A href=3D"mailto:jroth1@t=
elus.net">mailto:jroth1@telus.net</A>]</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; Sent: Friday, September 05, 2003 12:35=
 PM</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; To: <A href=3D"mailto:php-db@lists.php=
=2Enet">php-db@lists.php.net</A></DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; Subject: Re: [PHP-DB] Modify MySQL Rec=
ord</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; Yah, I noticed that after I had submit=
ted this, and fixed it</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; - still no</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; change - gives the same exact error.</=
DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; "Jeffrey N Dyke" &lt;<A href=3D"mailto=
:jeffrey_n_Dyke@Keane.com">jeffrey_n_Dyke@Keane.com</A>&gt; wrote in mess=
age</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; <A href=3D"mailto:news:OFFEE2B14B.9BAC=
564B-ON85256D98.005AAEE6@keane.com">news:OFFEE2B14B.9BAC564B-ON85256D98.0=
05AAEE6@keane.com</A>...</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; looks like you stopped putting co=
mmas after your fields at</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " formation =3D '=
$formation' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " perfs =3D '$per=
fs' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " event =3D '$eve=
nt' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " fluid =3D '$flu=
id' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; hth</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Jeff</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; "Jeff"</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &lt;<A href=3D"mailto:jroth1@telu=
s.net">jroth1@telus.net</A> To:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; <A href=3D"mailto:php-db@lists.php.net=
">php-db@lists.php.net</A></DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; &gt; cc:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Subject:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; [PHP-DB] Modify</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; MySQL Record</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; 09/05/2003 12:28</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; PM</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Helloooo!</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; I'm having a small problem with m=
odifying the data in a</DIV>
<DIV>&gt; &gt; &gt; &gt; MySQL DB.</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; And here's the error:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; (After I click the "Submit Change=
s" button) Error: 1064:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; You have an error</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; in your SQL syntax near '(10-10-1=
0-10)' kwo=3D'1235',</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; lsd=3D'10-10-10-10',</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; date=3D'2003-05-05', well' at lin=
e 1</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; Here's the code:</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; function edit_record() {</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; global $default_dbname, $gradient=
_tablename,</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; $access_log_tablename;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; global $new_lsd, $kwo, $lsd, $dat=
e, $well, $field,</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $uni, $license, $formation, $perf=
s, $event,</DIV>
<DIV>&gt; &gt; $fluid, $mode,</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $type, $vhd, $file, $kb, $grd, $o=
pen, $sour, $tube,</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $landed, $casing, $landed2, $shut=
_date, $shut_time,</DIV>
<DIV>&gt; &gt; &gt; &gt; $pres, $tag;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(empty($kwo)) error_message('Em=
pty Gradient!');</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $link_id =3D db_connect($default_=
dbname);</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!$link_id) error_message(sql_e=
rror());</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str =3D '';</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if($kwo !=3D $new_kwo) $field_str=
 =3D " kwo =3D '$new_kwo', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!empty($lsd)) {</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " lsd =3D other_l=
sd('$lsd') ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; }</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " kwo =3D '$kwo',=
 ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " lsd =3D '$lsd',=
 ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " date =3D '$date=
', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " well =3D '$well=
', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " field =3D '$fie=
ld', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " uni =3D '$uni',=
 ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " license =3D '$l=
icense', ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " formation =3D '=
$formation' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " perfs =3D '$per=
fs' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " event =3D '$eve=
nt' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " fluid =3D '$flu=
id' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " mode =3D '$mode=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " type =3D '$type=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " vhd =3D '$vhd' =
";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " file =3D '$file=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " kb =3D '$kb' ";=
</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " grd =3D '$grd' =
";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " open =3D '$open=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " sour =3D '$open=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " tubing =3D '$tu=
bing' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " landed =3D '$la=
nded' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " casing =3D '$ca=
sing' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " landed2 =3D '$l=
anded2' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " shut_date =3D '=
$shut_date' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " sut_time =3D '$=
shut_time' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " pres =3D '$pres=
' ";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $field_str .=3D " tag =3D '$tag' =
";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $query =3D "UPDATE $gradient_tabl=
ename SET $field_str WHERE</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; kwo =3D '$kwo'";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $result =3D mysql_query($query);<=
/DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!$result) error_message(sql_er=
ror());</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $num_rows =3D mysql_affected_rows=
($link_id);</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!$num_rows) error_message("Not=
hing changed!");</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if($lsd !=3D $new_kwo) {</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $query =3D "UPDATE $access_log_ta=
blename SET kwo =3D</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; '$new_kwo' WHERE kwo</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; =3D</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; '$kwo'";</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; $result =3D mysql_query($query);<=
/DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; if(!$result) error_message(sql_er=
ror());</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; user_message("All records regardi=
ng $lsd have been</DIV>
<DIV>&gt; &gt; &gt; &gt; changed!",</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; "$PHP_SELF?action=3Dview_record&amp;kwo=3D$new_kwo");</DIV=
>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; }</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; else {</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; user_message("All records regardi=
ng $lsd have been</DIV>
<DIV>&gt; &gt; &gt; &gt; changed!");</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; }</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; }</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; --</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; PHP Database Mailing List (<A hre=
f=3D"http://www.php.net/">http://www.php.net/</A>)</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; &gt; To unsubscribe, visit: <A href=3D=
"http://www.php.net/unsub.php">http://www.php.net/unsub.php</A></DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; --</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; PHP Database Mailing List (<A href=3D"=
http://www.php.net/">http://www.php.net/</A>)</DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt; To unsubscribe, visit: <A href=3D"http=
://www.php.net/unsub.php">http://www.php.net/unsub.php</A></DIV>
<DIV>&gt; &gt; &gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt; &gt; &gt; --</DIV>
<DIV>&gt; &gt; &gt; &gt; PHP Database Mailing List (<A href=3D"http://www=
=2Ephp.net/">http://www.php.net/</A>)</DIV>
<DIV>&gt; &gt; &gt; &gt; To unsubscribe, visit: <A href=3D"http://www.php=
=2Enet/unsub.php">http://www.php.net/unsub.php</A></DIV>
<DIV>&gt; &gt; &gt; &gt;</DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&gt; &gt; --</DIV>
<DIV>&gt; &gt; PHP Database Mailing List (<A href=3D"http://www.php.net/"=
>http://www.php.net/</A>)</DIV>
<DIV>&gt; &gt; To unsubscribe, visit: <A href=3D"http://www.php.net/unsub=
=2Ephp">http://www.php.net/unsub.php</A></DIV>
<DIV>&gt; &gt;</DIV>
<DIV>&nbsp;</DIV>
<DIV>--</DIV>
<DIV>PHP Database Mailing List (<A href=3D"http://www.php.net/">http://ww=
w.php.net/</A>)</DIV>
<DIV>To unsubscribe, visit: <A href=3D"http://www.php.net/unsub.php">http=
://www.php.net/unsub.php</A></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>.</DIV></TD></TR>
<TR>
<TD id=3DINCREDIFOOTER width=3D"100%">
<TABLE cellSpacing=3D0 cellPadding=3D0 width=3D"100%">
<TBODY>
<TR>
<TD width=3D"100%"></TD>
<TD id=3DINCREDISOUND vAlign=3Dbottom align=3Dmiddle></TD>
<TD id=3DINCREDIANIM vAlign=3Dbottom align=3Dmiddle></TD></TR></TBODY></T=
ABLE></TD></TR></TBODY></TABLE><SPAN id=3DIncrediStamp><SPAN dir=3Dltr><F=
ONT face=3D"Arial, Helvetica, sans-serif" size=3D2>______________________=
______________________________<BR><FONT face=3D"Comic Sans MS" size=3D2><=
A href=3D"http://www.incredimail.com/redir.asp?ad_id=3D309&amp;lang=3D9">=
<IMG alt=3D"" hspace=3D0 src=3D"cid:11E4B9D9-16F6-452C-B50A-8C7D828B6984"=
 align=3Dbaseline border=3D0></A>&nbsp; <I>IncrediMail</I> - <B>Email has=
 finally evolved</B> - </FONT><A href=3D"http://www.incredimail.com/redir=
=2Easp?ad_id=3D309&amp;lang=3D9"><FONT face=3D"Times New Roman" size=3D3>=
<B><U>Click Here</U></B></FONT></A></SPAN></SPAN></FONT></BODY></HTML>
--------------Boundary-00=_GKBRLVC0000000000000--

--------------Boundary-00=_FKBRQL80000000000000--
