PHP - How Can I Accomplish This...!?
Similar TutorialsI would like to have database entries or rows, be outputted into "panels" with independent x's on them to delete an entry. I think I've got the update / delete stuff figured out, what I don't know is how to hold down an entry and drag it up / down with the other's reacting and then this reorders them eg. updates database ID numbers.
Any thoughts?
Let's say for example I have 3 ID's in ONE database row like this: name: values: page ids 17 23 32 And I have a list of page titles with the ID's of the pages inserted into the value field of a checkbox. [] page title 1 [] page title 2 [] page title 3 [] page title 4 [] page title 5 [] page title 6 What I Want to Do! I want to fetch the page ID's from the database and I want a way to see if there match any page ID's from the list with the page ID's from the database row. Based on that I want to run an if statement. How can I do that? The string of ID's from the database would be the haystack, and the ID's from the list would be the needles, and every time one ID from the haystack matches with an ID from the list then that page title should be automatically marked as checked with the help of an if statement. This is how the list gets listed, with a foreach loop: <?php $pages = get_pages(); foreach ($pages as $pagg) { $option = '<input type="checkbox" name="exclude[]" value="'. $pagg->ID .'">'; $option .= $pagg->post_title . "<br />"; echo $option; } ?> Now I need to compare the ID in the value field with the ID string (separated by spaces) in the database row, and when a match occurs then execute a case. I know there are functions like str_replace and similar, but I'm not sure if I can do that with them, what would be a fitting function for my case? Hello, I'm building a blog post website, and now I'm on the search part of it. I have a search field which I instruct the user to type in "keywords" they want to search for. The words they type in there are then to be searched in the "title" and "content" of each post in the "posts" table. Here's an example query of my current setup: SELECT * FROM (`posts`) WHERE MATCH(title,content) AGAINST('+term1* ' IN BOOLEAN MODE); This works fine if I have one or two words in they keywords. If I, however, copy and paste an entire sentence from an existing blog post, no results are found ??? Here's an example of a query where I just copy+pasted a sentence from a blog post: SELECT * FROM (`posts`) WHERE MATCH(title,content) AGAINST('+Hello* +everyone* +my* +name* +is* +Bob* ' IN BOOLEAN MODE); Yet, a search for just "Bob" returns the proper result. WHY? What's a better way to perform this search?! |