Page 1 of 1
Total Newbie Question
Posted: Wed Jan 28, 2009 9:47 am
by chrismitchell
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
Re: Total Newbie Question
Posted: Sun Feb 01, 2009 3:05 am
by jaoudestudios
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."%'"
Re: Total Newbie Question
Posted: Sun Feb 01, 2009 5:54 am
by greyhoundcode
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
Re: Total Newbie Question
Posted: Sun Feb 01, 2009 9:16 am
by JAB Creations
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.