<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1019540" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1019540</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/3-simple-questions-plus-1-more#comment-1117346</link>
    <description> &lt;p&gt;I prefer to through as much work at the mysql DB as (resonably) possible.&lt;/p&gt;
&lt;p&gt;Question 2/3:&lt;br /&gt;
datestamp?  That&#039;s not a mySQL data type.  I&#039;m guessing timestamp(&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt;. Anyway...&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;SELECT if(date_field=0, &amp;#039;unknown&amp;#039;, DATE_FORMAT(date_field, &amp;#039;%m/%d/%Y&amp;#039;)) as date_field;&lt;br /&gt;&lt;br /&gt;/* OR */&lt;br /&gt;&lt;br /&gt;SELECT if(date_field=0, &amp;#039;unknown&amp;#039;, DATE_FORMAT(date_field, &amp;#039;%M %e, %Y&amp;#039;)) as date_field;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;Question 4:&lt;br /&gt;
The solution above is specific to mySQL.  It&#039;s using regex to search the records.  The section isn&#039;t documented well in the mySQL docs (at least, not that I&#039;ve found).&lt;/p&gt;
 </description>
     <pubDate>Fri, 01 Nov 2002 09:01:11 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1117346 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/3-simple-questions-plus-1-more#comment-1117333</link>
    <description> &lt;p&gt;I got the answer to #4 &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;Instead of  using &quot;LIKE&quot;, the query should be&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;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM alumni WHERE lastname RLIKE &#039;^[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lastname&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;]&#039;\&quot;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$result&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = mysql_query (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;And with switching from LIKE to RLIKE, the variable $lastname changes from A% (for just beginning with A) to either ABCD or A-D!  Note:  the variable is actually [A-D] with brackets but I chose to keep the brackets out of the url part of it.&lt;/p&gt;
&lt;p&gt;I love it when things actually work out! &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 01 Nov 2002 05:08:14 +0000</pubDate>
 <dc:creator>fifeclub</dc:creator>
 <guid isPermaLink="false">comment 1117333 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Re: 3 simple questions, plus 1 more</title>
    <link>https://www.webmaster-forums.net/web-database-development/3-simple-questions-plus-1-more#comment-1117293</link>
    <description> &lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote: &lt;em&gt;Originally posted by fifeclub &lt;/em&gt;&lt;br /&gt;
&lt;strong&gt;QUESTION #1:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Out of curiosity, what is the significance of \n before the &quot;; at the end of a a print statement?  It prints either way, so what does the \n do?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;\n denotes a new line. It&#039;s like  but it only changes how it&#039;s displayed in the source. I recommend using it so your source isn&#039;t cluttered when people want to view it.&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
QUESTION #2:&lt;/p&gt;
&lt;p&gt;I use a datestamp(&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt; field which produces dates like this &quot;20021031&quot;.  Is there an easy way to make this print/display in any human-fiendly format?  Either &quot;10/31/2002&quot; (US format) or &quot;October 31, 2002&quot;?&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;You can use SUBSTR($date, 0, 4) for the year (2002), SUBSTR($date, 4,2) for the month, and SUBSTR($date, 6, &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt; for day. In PHP it would look like this:&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;$date &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;20021031&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;substr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;substr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;2&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;substr&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;6&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;8&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// 10/31/02&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;.\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;/\&quot;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;.\&quot;/\&quot;.&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;// October 31, 2002&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$months&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = array(\&quot;January\&quot;, \&quot;Feburary\&quot;, \&quot;March\&quot;, \&quot;April\&quot;, \&quot;May\&quot;, \&quot;June\&quot;, \&quot;July\&quot;, \&quot;August\&quot;, \&quot;September\&quot;, \&quot;October\&quot;, \&quot;November\&quot;, \&quot;December\&quot;);&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; - 1;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dmon&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$months&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$month&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;;&lt;br /&gt;&lt;br /&gt;echo (\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$dmon&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$day&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;);&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.php.net/substr&quot; class=&quot;bb-url&quot;&gt;More on Substr&lt;/a&gt;&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
QUESTION #3:&lt;/p&gt;
&lt;p&gt;Related to #2, is there an easy way to make a datestamp(&lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/nerdy.png&quot; title=&quot;Cool&quot; alt=&quot;Cool&quot; class=&quot;smiley-content&quot; /&gt; value of 00000000 print as the text &quot;unknown&quot; or to not print anything at all?  I suppose this could be for any field value result.  Is it possible to do something like &#039;if fieldname=00000000 then make other-value&#039; (where it would print that other-value instead)?&lt;/p&gt;&lt;/blockquote&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$date &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;== &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;00000000&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) {&lt;br /&gt;&amp;nbsp; echo (\&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Unknown\&quot;);&lt;br /&gt;} else {&lt;br /&gt;&amp;nbsp; // ... Date code from above&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
QUESTION #4 (not as simple as the others):&lt;/p&gt;
&lt;p&gt;From my link above, my &quot;Locations&quot; script uses the following method for the query  to include multiple non-intiger values (the key being &quot;IN&quot;):&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;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM alumni WHERE state IN (\&quot;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$location&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;\&quot;)\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;My &quot;Last Name Starting With The Letter x&quot; script uses the following method for the query (the keys being &quot;LIKE&quot;) and the string variable is formatted as &quot;x%&quot;:&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;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= \&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;SELECT * FROM alumni WHERE lastname LIKE &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$lastname&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;\&quot;;&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;What I want to do is kind of combine these concepts to display last names beginning with the letters A%,B%,C%,D%,E% (beginning with any of these multiple values).  My first attempt failed and I just wanted to know if this can possibly work if I just fiddle around enough with the syntax and formatting?  Am I on the right track or is this just all wrong and there&#039;s a different way to do this? [/B]&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;Look into arrays and the for function some, I asked a similar question. If you want to see the code I got just ask and I&#039;ll give you a link to it.&lt;/p&gt;
&lt;p&gt;Hope I helped you some, good luck!&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Oct 2002 20:04:08 +0000</pubDate>
 <dc:creator>necrotic</dc:creator>
 <guid isPermaLink="false">comment 1117293 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
