Troubles when I want to connect to another DB

Use code as below : <?php $myotherdatabase = new wpdb(“username”,”password”,”databasename”,”localhost”); $motscles = “abri”; $query = “SELECT `post_id` FROM `wp_postmeta` WHERE `meta_key` = ‘nom’ AND MATCH (`meta_value`) AGAINST (‘” . $motscles . “‘ IN BOOLEAN MODE)”; $result = $myotherdatabase -> get_results($query, ARRAY_A); foreach ($result as $post) { $pids .= $post->post_id . “,”;// ARRAY_A } echo $pids; … Read more

Getting values from form and saving in database but spaces are inserted instead of form values

<?php /* Template Name: Dummy Practice Page*/?> <div id=”main-content” class=”main-content”> <div class=”main-content-inner”> <form method=”post”> <p><div> <input name=”nametxt” id=”nametxt” type=”text” style=”height:30px; width: 350px; ” maxlength=”5″ placeholder=”Name” required><br> </p></div> <p><div> <input name=”designationtxt” id=”designationtxt” type=”text” style=”height:30px; width: 350px; ” maxlength=”50″ placeholder=”Designation” required><br> </p></div> <p><div> <input name=”descriptiontxt” id=”descriptiontxt” type=”text” style=”height:30px; width: 350px; ” maxlength=”1000″ placeholder=”Description” required><br> </p></div> <input id=”submitbtn” … Read more