View Single Post
Old 20-08-2005, 00:20   #4
Raistlin
Inactive
 
Join Date: Feb 2004
Location: There's no place like 127.0.0.1
Services: Depends on the person and the price they're offering
Posts: 12,384
Raistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered stars
Raistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered starsRaistlin is seeing silvered stars
Re: Help needed with web forms:

Ok, I've got the form part working, it passes two variables to a .php page.

The .php page queries a database and returns some values, based upon what was input in the form.

I then need to take some of the values from the record and some of the values from the form and perform an UPDATE.

So, from the form:

$usrInputName
$usrInputSearch

The SELECT query (which works) is:

PHP Code:
$result = mysql_query("SELECT * FROM tblMyTable WHERE requiredfield = '$usrInputSearch'",$link); 
I can then "echo" all of the fields from the one returned record so that they output in the browser.

What I now need to do is take the usrInputName value and append it to the end of what is currently in one of the fields returned by the SELECT statement.

So, I'm doing this:

PHP Code:
mysql_query("UPDATE tblMyTable SET TheFieldToAmend = $row[TheFieldToAmend] . '<BR>' . $usrInputName WHERE id = $row[id] LIMIT 1"); 
So:

If TheFieldToAmend = This
And $usrInputName = Raistlin

I want the value of TheFieldToAmend for the selected record (identified by $row[id] returned by the SELECT query) to be:

This<BR>Raistlin
Raistlin is offline   Reply With Quote