Re: [PHP] update mysql using radio button

2004-06-01 Thread Daniel Clark
Right.  (oops)

> From: "Daniel Clark" <[EMAIL PROTECTED]>
>
>>  if($row->club_member
>>  ='N'){echo 'CHECKED';}?>>
>
> =='N', you mean. :)
>
> ---John Holmes...

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



Re: [PHP] update mysql using radio button

2004-06-01 Thread John W. Holmes
From: "Daniel Clark" <[EMAIL PROTECTED]>

> club_member
>  ='N'){echo 'CHECKED';}?>>

=='N', you mean. :)

---John Holmes...

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



RE: [PHP] update mysql using radio button

2004-06-01 Thread Matt Newell

how embarrassing. :] yes, of course that would be the problem.

just to note, i'm enjoying learning php/mysql and appreciate the help
from this list. it's a great community and the good will makes it a
great place to ask the sometimes really stupid questions.

best,
m.


-Original Message-
From: Daniel Clark [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 01, 2004 1:14 PM
To: Matt Newell
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] update mysql using radio button

I think you need Values for the radio buttons.

club_member  ='N'){echo 'CHECKED';}?>>

>
> hello all -
>
> i'm having a problem getting an UPDATE to work with radio buttons and 
> i'm not sure where it's gone wrong. the initial values are being 
> grabbed properly, but unfortunately they don't want to get updated. 
> the regular text form values update just fine. would appreciate some
help.
>
> the html:
>
> 
>
> club member?
> No: club_member 
> ='N'){echo 'CHECKED';}?>>
> Yes: club_member

> == 'Y'){echo 'CHECKED';}?>>
>
>
> the query to update:
>
> $query = "UPDATE outdoor SET name='$name', email='$email', zip='$zip',

> club_member='$club_member' WHERE id='$id'"; $result = 
> mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
>
>
> [trying to keep the code paste to what i think is important, let me 
> know if more is needed for info.]
>
>
> thanks!
> m.
>
> --
> PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: 
> http://www.php.net/unsub.php
>
>

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



Re: [PHP] update mysql using radio button

2004-06-01 Thread Daniel Clark
I think you need Values for the radio buttons.

club_member
 ='N'){echo 'CHECKED';}?>>

>
> hello all -
>
> i'm having a problem getting an UPDATE to work with radio buttons and
> i'm not sure where it's gone wrong. the initial values are being grabbed
> properly, but unfortunately they don't want to get updated. the regular
> text form values update just fine. would appreciate some help.
>
> the html:
>
> 
>
> club member?
> No: club_member
> ='N'){echo 'CHECKED';}?>>
> Yes: club_member
> == 'Y'){echo 'CHECKED';}?>>
>
>
> the query to update:
>
> $query = "UPDATE outdoor SET name='$name', email='$email', zip='$zip',
> club_member='$club_member' WHERE id='$id'";
> $result = mysql_query($query) or die ("Error in query: $query. " .
> mysql_error());
>
>
>
> [trying to keep the code paste to what i think is important, let me know
> if more is needed for info.]
>
>
> thanks!
> m.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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



RE: [PHP] update mysql using radio button

2004-06-01 Thread Jay Blanchard
[snip]
i'm having a problem getting an UPDATE to work with radio buttons and
i'm not sure where it's gone wrong. the initial values are being grabbed
properly, but unfortunately they don't want to get updated. the regular
text form values update just fine. would appreciate some help.

the html:



club member?
No: club_member ==
'N'){echo 'CHECKED';}?>>
Yes: club_member
== 'Y'){echo 'CHECKED';}?>>
[/snip]

You have to create a value for the box...or check for ON

function radioBox($radioBoxState){
/*
** this function will get the tail value of the checked radio
button
** and return the appropriate value for use by the database,
either a
** 'y' or 'n'
*/
if(TRUE == preg_match('/Yes/', $radioBoxState)){
$radioBoxState = "y";
} elseif(TRUE == preg_match('/No/', $radioBoxState)){
$radioBoxState = "n";
}
return $radioBoxState;
}
function checkBox($checkBoxState){
/* 
** this is a function that will turn an 'on' checkbox into a 'y'
for the database
** if it is not 'on' an 'n' will be returned
*/
if("on" == $checkBoxState){
$checkBoxData = "y";
} else {
$checkBoxData = "n";
}
return $checkBoxData;

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



[PHP] update mysql using radio button

2004-06-01 Thread Matt Newell

hello all -

i'm having a problem getting an UPDATE to work with radio buttons and
i'm not sure where it's gone wrong. the initial values are being grabbed
properly, but unfortunately they don't want to get updated. the regular
text form values update just fine. would appreciate some help.

the html:



club member?
No: club_member ==
'N'){echo 'CHECKED';}?>>
Yes: club_member
== 'Y'){echo 'CHECKED';}?>>


the query to update:

$query = "UPDATE outdoor SET name='$name', email='$email', zip='$zip',
club_member='$club_member' WHERE id='$id'";
$result = mysql_query($query) or die ("Error in query: $query. " .
mysql_error());



[trying to keep the code paste to what i think is important, let me know
if more is needed for info.]


thanks!
m.

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



Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
Something I like to do during troubleshooting is to have the page display
the SQL statement I'm processing.

Something like:  print sql_query ;

That was I can verify all the parameters are correct.


Do you have autocommit ON?   Or need to pass a commit statement?

Daniel Clark



> Of course, I didn't notice I left that line out of my code, although I did
> remember to put in the closing form tag. But, unfortumately, the update is
> not executed. The form button works, and it appears to do what it should,
> but the data is not changed.
> I changed the form method to get so I could see what is being passed and
> everything there is fine, but at the end of the url I see this-
> url...stuff...&submit=Update+Data
> Is this correct?
>
> What else can I do to see what was passed to the database (if anything)?
> --
> Chip

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



Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
"Daniel Clark" <[EMAIL PROTECTED]> wrote on 04/07/2004 10:17:36 AM:

> For the submit button to work it has to be in a form.
> 
> 
>
> 
> 
> Hope this helps.
> 
> Daniel Clark

Of course, I didn't notice I left that line out of my code, although I did 
remember to put in the closing form tag. But, unfortumately, the update is 
not executed. The form button works, and it appears to do what it should, 
but the data is not changed. 
I changed the form method to get so I could see what is being passed and 
everything there is fine, but at the end of the url I see this-
url...stuff...&submit=Update+Data
Is this correct?

What else can I do to see what was passed to the database (if anything)?
--
Chip

> > 
> > ... more code ...
> > 
> >  > endif;
> > ?>
> > 
> > 
> > -
> >
> > I don't see any reason for the submit button to not work at all. What
> > should I look for now?
> > Thanks for the help,
> > Chip
> 
> 

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



Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
For the submit button to work it has to be in a form.


   


Hope this helps.

Daniel Clark

> 
> ... more code ...
> 
>  endif;
> ?>
> 
> 
> -
>
> I don't see any reason for the submit button to not work at all. What
> should I look for now?
> Thanks for the help,
> Chip

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



Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
"Daniel Clark" <[EMAIL PROTECTED]> wrote on 04/06/2004 03:27:34 PM:

> I think you need a WHERE clause for the UPDATE, otherwise it will update
> ALL the records.
> 
> e.g.  WHERE OwnerName='$result'
> 
> Then perhaps a redirect to another page.

Thanks for the reminder. I set that, and found the problem that caused the 
page to not load at all - no closing double-quote on the update statement.
Now the page loads properly but when I press the submit button nothing 
happens, it's a dead button.

--
if(isset($submit)):
$query1 = "update warranty set 
VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother')
 
where OwnerName = $OwnerName";
   $result1 = mysql_query($query1);
   mysql_query($query1); 
else:
   $query = "select * from warranty WHERE OwnerName='$result'"; 
   $results = mysql_query($query);
   $row = mysql_fetch_array($results);
?>
... lots of code ...

... more code ...




-

I don't see any reason for the submit button to not work at all. What 
should I look for now?
Thanks for the help,
Chip

> > I probably need to use if(isset($submit)): and an update statement, 
but my
> > attempt just causes the web page to display completely blank. This is 
what
> > I tried -
> >
> > if(isset($submit)):
> >  $query1 = "update warranty set
> > VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',
> OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',
> OwnerCountry='$country',DateInstalled='$DateInstalled',
> DealerName='$Dealer',DealerStreet='$DealerAddress',
> DealerCity='$DealerCity',DealerState='$DealerState',
> DealerZip='$DealerZip',DealerCountry='$DealerCountry',
> Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',
> VesselLength='$length',InstalledOn='$construction',
> VesselTypeOther='$vesseltypeother')
> > ;
> >  $result1 = mysql_query($query1);
> >  mysql_query($query1);
> > else:
> >  $query = "select * from warranty WHERE OwnerName='$result'";
> > $results = mysql_query($query);
> >  $row = mysql_fetch_array($results);
> > ?>
> 
> 

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



Re: [PHP] update mysql from php web page

2004-04-06 Thread John Nichel
Chip Wiegand wrote:
I have an existing web page that pulls some data and displays it in form 
input fields. I would like to add the ability to edit those fields and 
submit the changes to the server, but have been unsuccessful. What bit of 
code do I need to add to the existing code?
This is the existing code to display the info --

 $query = "select * from warranty WHERE OwnerName='$result'"; 
 $results = mysql_query($query);
 $row = mysql_fetch_array($results);

I probably need to use if(isset($submit)): and an update statement, but my 
attempt just causes the web page to display completely blank. This is what 
I tried -

if(isset($submit)):
 $query1 = "update warranty set 
VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother') 
;
 $result1 = mysql_query($query1);
 mysql_query($query1); 
else:
 $query = "select * from warranty WHERE OwnerName='$result'"; 
$results = mysql_query($query);
 $row = mysql_fetch_array($results);
?>

What am I doing wrong?
Thanks,
--
Chip 

register_globals is probably off

echo out the query to see if your variables are populated.

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] update mysql from php web page

2004-04-06 Thread Daniel Clark
I think you need a WHERE clause for the UPDATE, otherwise it will update
ALL the records.

e.g.  WHERE OwnerName='$result'

Then perhaps a redirect to another page.


> I probably need to use if(isset($submit)): and an update statement, but my
> attempt just causes the web page to display completely blank. This is what
> I tried -
>
> if(isset($submit)):
>  $query1 = "update warranty set
> VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother')
> ;
>  $result1 = mysql_query($query1);
>  mysql_query($query1);
> else:
>  $query = "select * from warranty WHERE OwnerName='$result'";
> $results = mysql_query($query);
>  $row = mysql_fetch_array($results);
> ?>

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



[PHP] update mysql from php web page

2004-04-06 Thread Chip Wiegand
I have an existing web page that pulls some data and displays it in form 
input fields. I would like to add the ability to edit those fields and 
submit the changes to the server, but have been unsuccessful. What bit of 
code do I need to add to the existing code?
This is the existing code to display the info --

 $query = "select * from warranty WHERE OwnerName='$result'"; 
 $results = mysql_query($query);
 $row = mysql_fetch_array($results);

I probably need to use if(isset($submit)): and an update statement, but my 
attempt just causes the web page to display completely blank. This is what 
I tried -

if(isset($submit)):
 $query1 = "update warranty set 
VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother')
 
;
 $result1 = mysql_query($query1);
 mysql_query($query1); 
else:
 $query = "select * from warranty WHERE OwnerName='$result'"; 
$results = mysql_query($query);
 $row = mysql_fetch_array($results);
?>

What am I doing wrong?
Thanks,

--
Chip 

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



Re: [PHP] UPDATE MySQL

2002-11-13 Thread Vernon Webb
I made some modifications to the code and I do not get ant error messages, 
but the database is still not updated. Here's the code:




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




Re: [PHP] UPDATE MySQL

2002-11-13 Thread Justin French
on 14/11/02 8:20 AM, vernon ([EMAIL PROTECTED]) wrote:

> Can anyone tell me what's wrong with theis code. I don't get any errors but
> the databse is never updated:
> 
>  $hostname_connPENPALS = "localhost";
> $database_connPENPALS = "phpenpals";
> $username_connPENPALS = "username";
> $password_connPENPALS = "password";
> 
> $connPENPALS = mysql_pconnect($hostname_connPENPALS,
> $username_connPENPALS, $password_connPENPALS) or die(mysql_error());
> $lastaccessdate = gmdate("M d, Y");
> $myuserid = $HTTP_SESSION_VARS['svUserID'];
> mysql_select_db($database_connPENPALS, $connPENPALS);
> $myquery = "UPDATE penpals SET lastaccess=$lastaccessdate WHERE
> ID=$myuserid";
> $result = mysql_query($myquery, $connPENPALS);
> header("Location: successfullogin.php");
> ?>

Try adding the line

echo mysql_error();

after the line

$result = mysql_query($myquery, $connPENPALS);

This should tell you if you have a mysql error... if not, then we can look
at other things..



Justin French

Creative Director
http://Indent.com.au
Web Developent & 
Graphic Design



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




Re: [PHP] UPDATE MySQL

2002-11-13 Thread Vernon Webb
Here's the thing. I'm trying to update a record when a user logs in. I have 
a login script that I am trying to have automatically update a record upon 
login. I figure the easiest way to do it is have the page submitted to 
another page which updated the record's last access date and then redircts 
to the actual page they are going to.

This however does not work I am getting a Parse error.



-- Original Message ---
From: Marco Tabini <[EMAIL PROTECTED]>
To: vernon <[EMAIL PROTECTED]>
Sent: 13 Nov 2002 17:18:18 -0500
Subject: Re: [PHP] UPDATE MySQL

> I can see two things that are not correct in the statement:
> 
> First, the date you're setting is in UNIX format--but MySQL wont' 
> like that. You need to use FROM_UNIXTIME.
> 
> Second, the username is a string (I guess), but it's not within
> quotation marks.
> 
> $myquery = "UPDATE penpals SET 
> lastaccess=FROM_UNIXTIME($lastaccessdate) WHERE ID='$myuserid'";
> 
> Two notes:
> 
> The MySQL extension does not normally print out errors. You need to
> explicity call mysql_error() to do that. In this case, you can add it
> after the call to mysql_query(), e.g.:
> 
> die (mysql_error());
> 
> Also, you are passing HTTP data directly to MySQL. This can allow a
> malicious user to insert potentially "evil" code in your call and cause
> all sorts of damage. I suggest you consider filtering that 
> information using one of the many methods available.
> 
> Marco
> 
> -- 
> 
> php|architect - The magazine for PHP Professionals
> The first monthly worldwide magazine dedicated to PHP programmers
> 
> Come visit us at http://www.phparch.com!
--- End of Original Message ---


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




Re: [PHP] UPDATE MySQL

2002-11-13 Thread Marco Tabini
I can see two things that are not correct in the statement:

First, the date you're setting is in UNIX format--but MySQL wont' like
that. You need to use FROM_UNIXTIME.

Second, the username is a string (I guess), but it's not within
quotation marks.

$myquery = "UPDATE penpals SET lastaccess=FROM_UNIXTIME($lastaccessdate)
WHERE ID='$myuserid'";

Two notes:

The MySQL extension does not normally print out errors. You need to
explicity call mysql_error() to do that. In this case, you can add it
after the call to mysql_query(), e.g.:

die (mysql_error());

Also, you are passing HTTP data directly to MySQL. This can allow a
malicious user to insert potentially "evil" code in your call and cause
all sorts of damage. I suggest you consider filtering that information
using one of the many methods available.


Marco


-- 

php|architect - The magazine for PHP Professionals
The first monthly worldwide magazine dedicated to PHP programmers

Come visit us at http://www.phparch.com!

--- Begin Message ---
Can anyone tell me what's wrong with theis code. I don't get any errors but
the databse is never updated:





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



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


[PHP] UPDATE MySQL

2002-11-13 Thread vernon
Can anyone tell me what's wrong with theis code. I don't get any errors but
the databse is never updated:





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




Re: [PHP] UPDATE mysql

2002-06-22 Thread 1LT John W. Holmes

> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";

I really hope you don't have register_globals on, or you are validating the
value of $table before you run this kind of query, otherwise your query is
open up to an attack to update any table in the database...

$table = "admin SET admin='Yes' WHERE username='John' #";

The # will make the remainder of your query a comment and it'll be ignored
by MySQL...

---John Holmes...


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




Re[2]: [PHP] UPDATE mysql

2002-06-22 Thread Julie Meloni

CS> Actually, it looks to me like you're missing a semicolon terminating 
CS> your SQL statement. Try this:

CS> $query="update $table set field1='$var1' where id='$id';";

Actually, that semicolon is not required (and I think it might even break it).

The user should echo the query as suggested previously, so as to
ensure that values for the variables are all actually there, and being
passed to MySQL.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20


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




Re: [PHP] UPDATE mysql

2002-06-22 Thread Chris Shiflett

Actually, it looks to me like you're missing a semicolon terminating 
your SQL statement. Try this:

$query="update $table set field1='$var1' where id='$id';";

1LT John W. Holmes wrote:

>It's correct for PHP, but there's no telling what MySQL is actually
>recieving.
>- Original Message -
>From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, June 22, 2002 2:44 PM
>Subject: [PHP] UPDATE mysql
>
>>I can't get UPDATE to work properly when querying MySQL.
>>
>>$query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
>>
>>I want to update one field of one row in a table.  Is this syntax
>>correct?
>>


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




Re: [PHP] UPDATE mysql

2002-06-22 Thread 1LT John W. Holmes

It's correct for PHP, but there's no telling what MySQL is actually
recieving. Are you sure all of those variables have values?? Yeah? Are you
really sure??

Use mysql_error() with your query.

$result = mysql_query("UPDATE ...") or die("Error in update: " .
mysql_error());

---John Holmes...
- Original Message -
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 22, 2002 2:44 PM
Subject: [PHP] UPDATE mysql


> I can't get UPDATE to work properly when querying MySQL.
>
> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
>
> I want to update one field of one row in a table.  Is this syntax
> correct?
>


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




[PHP] UPDATE mysql

2002-06-22 Thread Phil Schwarzmann

I can't get UPDATE to work properly when querying MySQL.

$query = "UPDATE $table SET field1='$var1' WHERE id='$id'";

I want to update one field of one row in a table.  Is this syntax
correct?



Re: [PHP] UPDATE - MySQL having some trouble

2002-01-23 Thread J.F.Kishor

hi,

> I can't the UPDATE command in MySQL to work properly.  Here is my
> query
>  
> $query = "update table set lastname=$lastname, firstname=$firstname
^
  replace table with

> where username=$username";

  ($lastname, $firstname, $username ) should be enclosed by quotes, if
all the fields are character.
 
>  
> Anything wrong with my syntax here?  

Goodluck!

cheers,
kishor
Nilgiri Networks.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] update mysql record

2001-12-08 Thread gee


Newbie is trying to edit a mysql record on my local machine using mysql
3.23.34 and PHP 4.04
and nothing gets updated after changes are made.
I would be most grateful for any help
Thank you
Gee.






"; ?>
Latin Name: ";
print "Common Name: ";
print "Description: ";
print "Height: ";
print "Growth Rate: ";
print "Soil Requirement: ";
print "Price 100: ";
print "Price 200: ";
print "Price 1000: ";

$id = $row->id;
}
echo "";
echo "";
?>





You left one or more fields blank.");
}

$sql = "UPDATE matai SET cat='$cat', latin_name='$latin_name',
common_name='$common_name',
description='$description', height='$height',
growth_rate='$growth_rate', soil_requirement='$soil_requirement',
price='$price', frost_tolerance='$frost_tolerance', price100='$price100',
price1000='$price1000', onelitretubes='$onelitretubes',
price200='$price200', fivelitrepots='$fivelitrepots', price10='$price10',
Flowering_Season='$Flowering_Season', price500='$price500'

   where id='$id'";
mysql_db_query('matai',$sql);
echo "Your record has been updated";

 }
mysql_close();
?>
View updated database







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]