I'm very new to writing PHP code by hand and i am needing to implement a search function to search a database in wordpress.. is this possible? If so can someone point out a tutorial?
I might be wrong with this as i am going from someone else in the company i work for. He suggested that i find a PHP code to search an array through wordpress..
all sound very alien to my designer mind LOL
Total Newbie Question
Moderator: General Moderators
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: Total Newbie Question
To search a column in the table called content and column called details, use something like this...
Code: Select all
$q = "SELECT * FROM content WHERE details LIKE '%".$keyword."%'"- greyhoundcode
- Forum Regular
- Posts: 613
- Joined: Mon Feb 11, 2008 4:22 am
Re: Total Newbie Question
Also, because its Wordpress, you might want to use the $wpdb object. You can find out some more about that by looking at http://codex.wordpress.org/wpdb_Class
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Re: Total Newbie Question
Learn relational databases which really isn't that difficult and you'll be able to program your own blog software. WordPress's code is so horrible...I can only imagine if Vladsun was paid to write a list of complaints you'd get a hundred or thousand times over your money's worth. Heck, I could probably give you ten times your monies worth.