<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018891" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018891</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/encode-decode#comment-1111778</link>
    <description> &lt;p&gt;In the decode() function, do not put the field name in quotes.&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;UPDATE user SET password=ENCRODE(&amp;quot;joyce&amp;quot;, &amp;quot;seed&amp;quot;) WHERE email=&amp;#039;$email&amp;#039;&lt;br /&gt;&lt;br /&gt;SELECT DECODE(password, &amp;quot;seed&amp;quot;) as password FROM user WHERE email=&amp;#039;$email&amp;#039;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 23 Jul 2002 16:53:28 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1111778 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/encode-decode#comment-1111721</link>
    <description> &lt;p&gt;Are you using the BLOB column type to save the encoded value? I think you have to use that type of column to save encoded data and be able to decode it.&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Jul 2002 12:35:23 +0000</pubDate>
 <dc:creator>Peter J. Boettcher</dc:creator>
 <guid isPermaLink="false">comment 1111721 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/encode-decode#comment-1111694</link>
    <description> &lt;p&gt;if all you want to do is keep the password from being readable in plain text, use the PASSWORD() function. &lt;/p&gt;
&lt;p&gt;something like this should work, although i dont have time to test it:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;INSERT INTO users(name,password) VALUES(&amp;#039;my name&amp;#039;,PASSWORD(&amp;#039;my password&amp;#039;));&lt;br /&gt;&lt;br /&gt;//validate the password&lt;br /&gt;// &amp;#039;entered password&amp;#039; is the password supplied by the user&lt;br /&gt;SELECT COUNT(*) AS passok FROM users WHERE username=&amp;#039;my name&amp;#039; AND password = PASSWORD(&amp;#039;entered password&amp;#039;) LIMIT 1;&lt;br /&gt;// the above query will return 0 for false (bad password) or 1 for true (good password)&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;or, you can use php&#039;s crypt function&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;$salt = &amp;#039;AB&amp;#039;;&lt;br /&gt;&lt;br /&gt;mysql_query(&amp;quot;INSERT INTO users(name,password) VALUES(&amp;#039;my name&amp;#039;,&amp;#039;&amp;quot;.crypt(&amp;#039;my password&amp;#039;,$salt).&amp;quot;&amp;#039;)&amp;quot;);&lt;br /&gt;&lt;br /&gt;// now the password is stored encrypted in the database&lt;br /&gt;// to validate a password encrypt what they supply before comparing&lt;br /&gt;&lt;br /&gt;$entered_password = crypt($entered_password,$salt);&lt;br /&gt;if($entered_password == $password_in_database) echo &amp;#039;password ok&amp;#039;;&lt;br /&gt;else echo &amp;#039;password bad&amp;#039;;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Jul 2002 01:37:42 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1111694 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
