<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1030365" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1030365</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/query-only-works-w-smart-quotes#comment-1176675</link>
    <description> &lt;p&gt;Ah, that&#039;s it. Thanks &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>Mon, 15 Aug 2005 23:18:43 +0000</pubDate>
 <dc:creator>IanD</dc:creator>
 <guid isPermaLink="false">comment 1176675 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/query-only-works-w-smart-quotes#comment-1176674</link>
    <description> &lt;p&gt;You still need them around the table name becasue of the hyphen in there. My reference to using them around a variable was if you are using the variable in place of a field name, table name or db name (which you are not). &lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Mon, 15 Aug 2005 22:57:39 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1176674 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/query-only-works-w-smart-quotes#comment-1176673</link>
    <description> &lt;p&gt;I took the quotes off of the table name and put them around the variable and am still getting the error message about the query result not being an object&lt;/p&gt;
&lt;p&gt;$query = &quot;SELECT * FROM ajax-zipcodes WHERE zipcode=`&quot; .$zip. &quot;`&quot;;&lt;/p&gt;
 </description>
     <pubDate>Mon, 15 Aug 2005 22:55:18 +0000</pubDate>
 <dc:creator>IanD</dc:creator>
 <guid isPermaLink="false">comment 1176673 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/web-database-development/query-only-works-w-smart-quotes#comment-1176671</link>
    <description> &lt;p&gt;The ` character (I always called it a &quot;backquote&quot;, mysql reference calls it a &quot;backtick&quot;.) is what mysql uses to wrap field, table and database names. That is just hte way it was programmed. If you are not using anythng special in the names, you don&#039;t need them&lt;/p&gt;
&lt;p&gt;   ie.  SELECT payrate FROM employees &lt;/p&gt;
&lt;p&gt;   However, if you ever use a variable for the field,table or db name, wrap it in the quote. &lt;/p&gt;
&lt;p&gt;   ie  $sql = &quot;SELECT payrate FROM `&quot; . $employeeTable . &quot;`&quot;&lt;/p&gt;
&lt;p&gt; The current project I maintain, about a year ago I ran into this problem. couldn&#039;t figure out why a new user crashed out. Here it was becasue of the hyphen in the username he picked. &lt;/p&gt;
&lt;p&gt; I quickly realized they were needed, especially in case someone created a username that happened to be a keyword in mySQL (ie. create, select, insert, from, where)&lt;/p&gt;
&lt;p&gt; ie. User WHERE tries to get data via above example sql statement, but without the backticks, would translate to this SQL being issued to the server: &lt;strong&gt;SELECT payrate FROM where&lt;/strong&gt; (I&#039;m sure you can see the problem here). With backticks, you get &lt;strong&gt;SELECT payrate FROM `where`&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;   -Greg&lt;/p&gt;
 </description>
     <pubDate>Mon, 15 Aug 2005 22:48:31 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1176671 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
