{"id":7264,"date":"2014-06-03T23:26:38","date_gmt":"2014-06-03T23:26:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/unexpected-field-in-mysql-fetch-data-collection-of-common-programming-errors\/"},"modified":"2014-06-03T23:26:38","modified_gmt":"2014-06-03T23:26:38","slug":"unexpected-field-in-mysql-fetch-data-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/unexpected-field-in-mysql-fetch-data-collection-of-common-programming-errors\/","title":{"rendered":"Unexpected field in Mysql fetch data-Collection of common programming errors"},"content":{"rendered":"<p>I have a query in which the data is lifted from the database. Eg: I have Category as a field which has values like Doctors, Pathologists etc which is taken from the database.<\/p>\n<pre><code> Category\n --------\n Doctors\n Pathologists\n Pediatrics\/Child Specialist ---&gt;&gt; Unwanted data\n<\/code><\/pre>\n<p>The problem is there is a data(value) in &#8216;Category&#8217; field which is unexpectedly showing in the list which is not in my database. I even tried to drop the table entirely and reload it but that field is still showing.<\/p>\n<p>Can anyone tell me why is this happening?<\/p>\n<p>Additional Info<\/p>\n<pre><code>function  getTierCategory()\n{\necho \"<br \/>\";\n$result = mysql_query(\"SELECT DISTINCT Category FROM doctors order by Category asc\") \nor die(mysql_error());\n\n  while($tier = mysql_fetch_array( $result )) \n\n    {\n       echo ''.$tier['Category'].'';\n    }\n\n}\n<\/code><\/pre>\n<p>I have tried renaming the field but how can I if this value is not even in my database.<\/p>\n<p>My Database looks like<\/p>\n<pre><code>Category | Qualification | State  | District\n--------------------------------------------\n<\/code><\/pre>\n<p>and so on<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a query in which the data is lifted from the database. Eg: I have Category as a field which has values like Doctors, Pathologists etc which is taken from the database. Category &#8212;&#8212;&#8211; Doctors Pathologists Pediatrics\/Child Specialist &#8212;&gt;&gt; Unwanted data The problem is there is a data(value) in &#8216;Category&#8217; field which is unexpectedly [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7264","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7264"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7264\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}