Database not working
-
I have created my own table on my wordpress database and created the filter search form, I also created result.php to my wordpress to output all searched products. Now, my problem is that, I dont know how to connect my database to my search filter form in wordpress.
I already created some of it but its not running..
Here’s my sample code
<?php define('WP_USE_THEMES', false); global $wpdb; $destination = $_POST["destination"]; echo "Welcome test" . $destination; $sql = "SELECT * FROM rates WHERE location = '" . $destination ."';"; echo $sql; echo "search this"; foreach ( $wpdb->get_results($sql) as $result ) { echo "search for". $result->location; } ?>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Database not working’ is closed to new replies.