Dynadot .com transfer sale, only $10.12 with coupon code DYNA12, available while supplies last, ends October 31, 2026.

Wordpress plugin help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
Spacemail by SpaceshipSpacemail by Spaceship
Watch
Impact
18
Hello friends

I am learning Wodpress plugin development

I have creating ads plugin for now.

I have done almost everything... Now facing problem in showing data from database

database structure is

Wordpress > customads > adone

i want to show value of adone

here is code i am using

function showcustomads() {
global $wpdb;
$table = $wpdb->prefix."customads";
$sql = 'SELECT adone FROM $table WHERE id = 1;';
$t = mysql_query($sql);
if ($t==1)
{ echo $adone; }

}

it doing nothing!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
try the following instead:-

PHP:
function showcustomads() {
global $wpdb;
$table = $wpdb->prefix."customads";
$sql = 'SELECT adone FROM $table WHERE id = 1;';
$t = $wpdb->get_row($sql);
if ($t==1)
{ echo $adone; }

}

although I am not 100% sure what you are trying to do in that if statement. Also are you sure you only want to select adone from the db where the ID is 1. You not meaning to limit to 1 instead?
 
0
•••
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Escrowly
CryptoExchange.com
Domain Recover

NamePros updates

New in Parking: updated way to act on many domains or inquiries at once
Your domain list and inquiry list now have a bar above and below the list. Check the items you want, then choose an action in the bar...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back