<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1038528" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1038528</link>
    <description></description>
    <language>en</language>
          <item>
    <title>Its functionng well</title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219719</link>
    <description> &lt;p&gt;Okay I got it functioning well now... The error is the &quot;row&quot; it should be &quot;dbRow&quot; &lt;/p&gt;
&lt;p&gt;Lots of lots of thanks GREG K!!!! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Sat, 26 May 2007 01:28:55 +0000</pubDate>
 <dc:creator>bluenote</dc:creator>
 <guid isPermaLink="false">comment 1219719 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219679</link>
    <description> &lt;p&gt;Here&#039;s the error i get... And the page with the form, I didnt get any result from the random pick anymore.&lt;/p&gt;
&lt;p&gt;Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &#039;&#039; at line 1&lt;/p&gt;
 </description>
     <pubDate>Fri, 25 May 2007 09:27:41 +0000</pubDate>
 <dc:creator>bluenote</dc:creator>
 <guid isPermaLink="false">comment 1219679 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219556</link>
    <description> &lt;p&gt;A couple of things:&lt;/p&gt;
&lt;p&gt;I looked at your page with the form. You need to actually put the ID of the record in the form, you have it set to just &quot;ID&quot;.&lt;/p&gt;
&lt;p&gt;A sample would be like this, assuming that the row ID is set in a fiend called `ID`, and the client name is in a field called `client`&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp; $dbServer &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;127.0.0.1:3307\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbUser&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;myusername\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbPass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;mypassword\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbName&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;agents\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbLink&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_connect(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbServer&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbUser&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbPass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(\&quot;Could not connect to database server\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; mysql_selectdb(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbName&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbLink&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(\&quot;Could not access database\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbQuery&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;SELECT * FROM `clients` ORDER BY Rand() LIMIT 1\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbResult&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbQuery&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(&#039;Invalid query: &#039; . mysql_error());&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbRow&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_fetch_assoc(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbResult&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;a href=\&quot;try.php\&quot;&amp;gt;Random Pick&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form id=\&quot;form1\&quot; name=\&quot;form1\&quot; method=\&quot;post\&quot; action=\&quot;update.php\&quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Agent:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input name=\&quot;agent\&quot; type=\&quot;text\&quot; id=\&quot;agent\&quot; value=\&quot;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;agent&#039;] \&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p&amp;gt;Comment:&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;textarea name=\&quot;comment\&quot; rows=\&quot;4\&quot; id=\&quot;comment\&quot;&amp;gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;comment&#039;] &amp;lt;/textarea&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;input type=\&quot;submit\&quot; name=\&quot;Submit\&quot; value=\&quot;Submit\&quot; /&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/p&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;input type=\&quot;hidden\&quot; name=\&quot;id\&quot; value=\&quot;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;ID&#039;] \&quot; /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; Client: = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;client&#039;] &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; Agent: = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;agent&#039;] &amp;lt;br /&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp; Comment: = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$row&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;comment&#039;] &lt;br /&gt;&amp;lt;/p&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Some notes for this one:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Note the reloaction/addition of the DIE statements to deal with any possible connection problems. It is a good habbit to get into, doing this way keeps the &#039;error&#039; messages right by what is generating them instead of in an ELSE after all the other code.&lt;/p&gt;
&lt;p&gt;I eliminated the while loop, since it is hard coded to only have one record, there is no need for it.&lt;/p&gt;
&lt;p&gt;You originately got the row result into an array that is numbered, however IMO using mysql_ fetch_ assoc is better for two reasons: 1. the code is easier to read/user ($row[&#039;agent&#039;] instead of $row[2]) and 2. if for some reason you modify the database and add/remove fields, your numbering scheme would be off)&lt;/p&gt;
&lt;p&gt;Lastly, I had the form auto fill in the current agent/comment data. If you choose to not have this, make sure you still *leave* the code alone in the hidden input line.&lt;/p&gt;
&lt;p&gt;Then on your update.php page, try something like:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// NOTE you should do more error checking on the values that come in through $_POST&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$agent &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;agent&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$comment &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;comment&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;id&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbServer &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;127.0.0.1:3307\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbUser&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;myusername\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbPass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;mypassword\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbName&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;agents\&quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbLink&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_connect(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbServer&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbUser&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbPass&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(\&quot;Could not connect to database server\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; mysql_selectdb(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbName&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbLink&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(\&quot;Could not access database\&quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbQuery&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = \&quot;UPDATE `clients` SET `agent`=&#039;\&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$agent&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . \&quot;&#039;, `comment`=&#039;\&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$comment&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; . \&quot;&#039; WHERE `id`=\&quot; . &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$id&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbResult&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dbQuery&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or die(&#039;Invalid query: &#039; . mysql_error());&lt;br /&gt;&lt;br /&gt;&amp;lt;p&amp;gt;Record Updated&amp;lt;/p&amp;gt;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Hope these help, and if they don&#039;t, to help further figuring it out, please post your table structure.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Wed, 23 May 2007 20:27:17 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1219556 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219532</link>
    <description> &lt;p&gt;Sorry but I&#039;m absolutely new to php... how will that code recognized the id from the first php script(the random pick).....&lt;/p&gt;
&lt;p&gt;Should i insert your given script with the  try.php(random pick) or would I create a new php file that will be called by the form action? What I did was like that, I create a php file called &quot;update.php&quot; &lt;/p&gt;
&lt;p&gt;here it is&lt;/p&gt;
&lt;p&gt;&amp;lt;?&lt;br /&gt;
$username=&quot;myusername&quot;;&lt;br /&gt;
$password=&quot;mypassword&quot;;&lt;br /&gt;
$database=&quot;agents&quot;;&lt;/p&gt;
&lt;p&gt;$agent=$_POST[&#039;agent&#039;];&lt;br /&gt;
$comment=$_POST[&#039;comment&#039;];&lt;br /&gt;
$id=$_POST[&#039;id&#039;];&lt;/p&gt;
&lt;p&gt;mysql_connect(mysql,$username,$password);&lt;br /&gt;
@mysql_select_db($database) or die( &quot;Unable to select database&quot;);&lt;/p&gt;
&lt;p&gt;$query = &quot;UPDATE clients set agent=$post[agent], comment=$post[comment] where id=$post[id]&quot;;&lt;br /&gt;
mysql_query($query);&lt;/p&gt;
&lt;p&gt;mysql_close();&lt;br /&gt;
?&amp;gt;&lt;/p&gt;
&lt;p&gt;and then I set the form to action=&quot;update.php&quot; but it didnt work. How will I update the selected file? Im so sorry im really new with php. Thanks again...&lt;/p&gt;
 </description>
     <pubDate>Wed, 23 May 2007 10:45:26 +0000</pubDate>
 <dc:creator>bluenote</dc:creator>
 <guid isPermaLink="false">comment 1219532 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219528</link>
    <description> &lt;p&gt;I went to your page and the deatils shown are:&lt;/p&gt;
&lt;p&gt;Client: Eanna Pitsburgh&lt;br /&gt;
Agent: Drinn&lt;br /&gt;
Last Comment: Call me again tomorrow... &lt;/p&gt;
&lt;p&gt;So your wanting to change the Agent and Last Comment for the Client, who in this case is Eanna Pitsburgh when the form is submitted?&lt;br /&gt;
If this is the case you need an id number (in the database and as a hidden form field) so on submission you just&lt;br /&gt;
update clients set agent=$_POST[agent], comment=$_POST[comment] where id=$_POST[id]&lt;/p&gt;
&lt;p&gt;this will replace the content in the database, if you wanted to just add another row of content then use &#039;insert into&#039; rather than &#039;update&#039;.&lt;/p&gt;
&lt;p&gt;you could use the agent name instead of the id but would run into problems with spaces in the name and dupilcates.&lt;br /&gt;
The code shown is only the last bit, you should of course validate the code and make sure it is there, is valid text without any symbols, script code, quotes or anything else that could destory your databases content/structure&lt;/p&gt;
 </description>
     <pubDate>Wed, 23 May 2007 09:35:47 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1219528 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219513</link>
    <description> &lt;p&gt;Thanks for the reply busy. Sorry maybe I didn&#039;t explain it right... Here is the link of the page I want to modify...&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://elitepromotionalservices.com/try.php&quot; class=&quot;bb-url&quot;&gt;http://elitepromotionalservices.com/try.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Every time the &quot;Random Pick&quot; link was click, it will display a random file... What I need to do is when the form with &quot;Agent&quot; and &quot;Comment&quot; filled up was submitted the current file displayed will be updated. The only fields I need to change was the agent and comment... I hope I explained it right. Thanks!!!&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 May 2007 21:28:40 +0000</pubDate>
 <dc:creator>bluenote</dc:creator>
 <guid isPermaLink="false">comment 1219513 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/random-pick-and-update#comment-1219512</link>
    <description> &lt;p&gt;If I got it right you just need to display the content from the database into form fields (input, textarea etc), then on submission of the form be sure to validate the information before updating the database, including addslashes to any content that allows them.&lt;/p&gt;
&lt;p&gt;To get just the details of the one you want change this line in the above code&lt;br /&gt;
echo &quot;Client: $row[1]Agent: $row[2]Last Comment: $row[3]&quot;;&lt;br /&gt;
to&lt;br /&gt;
echo &quot;Client: &lt;a&gt;&quot;.$row[1].&quot;&lt;/a&gt;Agent: $row[2]Last Comment: $row[3]&quot;;&lt;br /&gt;
which will make the clients name clickable. I have added $row[id] in hoping you are using an id in your database, if you are not, do, and make it unique and autoincrement&lt;/p&gt;
 </description>
     <pubDate>Tue, 22 May 2007 20:53:35 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1219512 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
