my sql query returns empty
$sql = $wpdb->get_results('SELECT * from table1 WHERE id = ' .$bransId);
And im sure that $bransId is not empty. ( i checked)
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communitymy sql query returns empty
$sql = $wpdb->get_results('SELECT * from table1 WHERE id = ' .$bransId);
And im sure that $bransId is not empty. ( i checked)
If you can answer 'yes' to the questions in Emetrop's comment, then try:
$sql = $wpdb->get_results('SELECT * from table1 WHERE id = $bransId');
$wpdb->prepare()
.
– birgire
Jul 21 '15 at 0:58