{"id":416,"date":"2011-09-02T20:44:31","date_gmt":"2011-09-03T00:44:31","guid":{"rendered":"http:\/\/www.kafraco.com\/blog\/?p=416"},"modified":"2011-09-02T20:44:31","modified_gmt":"2011-09-03T00:44:31","slug":"the-php-problem-i-am-having","status":"publish","type":"post","link":"https:\/\/www.kafraco.com\/blog\/2011\/09\/the-php-problem-i-am-having\/","title":{"rendered":"The PHP problem I am having"},"content":{"rendered":"<p>I am trying to create a webpage that searches a MySQL database. I can write a simple page that can search on one of the fields. For example: <code>SELECT * FROM table WHERE = $variable;<\/code><\/p>\n<p>What I need to do is figure out how to do the same thing but with more than one field (and they might be empty). For example: If there are three fields for entering search terms: Name, Rank, SerialNumber, but the user only puts in less than all of them, I want the query to be something like <code>SELECT * FROM table WHERE name` LIKE '%Named Person%' OR rank LIKE '%Rank Amateur%'<\/code><\/p>\n<p>However, I don&#8217;t want it to try and add <code>OR serialnumber LIKE'%%'<\/code> because that would mess everything up.<\/p>\n<p>If anybody could point me in the right direction, I would appreciate it. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to create a webpage that searches a MySQL database. I can write a simple page that can search on one of the fields. For example: SELECT * FROM table WHERE = $variable; What I need to do is figure out how to do the same thing but with more than one field [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[27],"tags":[98],"class_list":["post-416","post","type-post","status-publish","format-standard","hentry","category-posts","tag-programming"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1x9C8-6I","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/posts\/416","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/comments?post=416"}],"version-history":[{"count":1,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/posts\/416\/revisions"}],"predecessor-version":[{"id":417,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/posts\/416\/revisions\/417"}],"wp:attachment":[{"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/media?parent=416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/categories?post=416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kafraco.com\/blog\/wp-json\/wp\/v2\/tags?post=416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}