$wpdb function.
-
How do I get fetch all the data inside of a table?..
example
table Promo.. I need to search the table to see if “joe1234” is under the column of “id”.. if joe1234 is NOT in Promo => ID I need to insert the user name in the table.. if not echo “already taken”… I’ve gotten pretty much everything set up except for the fact of calling the data from the database..
Here’s the code ive been using
`
$data = mysql_query(“SELECT * FROM promocode”)
or die(mysql_error(‘not connected’));
$info = mysql_fetch_array( $data );if ($info[‘ID’] == $current_user->user_login) {
$wpdb->insert( ‘promocode’ , array( ‘CODE’ => $promocode , ‘ID’ => $myname ), array( ‘%s’, ‘%s’ ) );
}
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘$wpdb function.’ is closed to new replies.