Fixed it.
function getUserIDandPush($ul){
global $table_prefix; // Prefix for Database table
global $user_login;
global $wpdb; // WordPress WPDB database method
$dt = $table_prefix; //Tables Prefix
if (!is_user_logged_in() && isset($_SERVER['LOGON_USER'])) {
$as = $wpdb->get_results('SELECT * FROM '.$dt.'users WHERE user_login = "'.$ul.'" ');
$usID = $as[0]->ID;
wp_set_current_user($usID, $ul);
wp_set_auth_cookie($usID);
do_action('wp_login', $ul);
}
}
Related Posts:
- How to fetch an array in $wpdb?
- $wpdb->get_results in not an array
- Can’t seem to get set_blog_id working, it just doesn’t reset the blog ID
- $wpdb returns duplicate posts
- Can’t update multiple rows with $wpdb query
- How do I count columns on a custom WPDB query?
- how to get db values without using an loop with wpdb->get_results()
- Create new database through static page code
- $wpdb – joining shows no result
- Mixing variables into an array when inserting values
- Custom SQL query ORDER BY term_order
- Custom $wpdb returns unexpected time based results
- Trouble inserting string containing quotations marks with wpdb in save_post hook
- Wpdb->insert() doesn’t insert new row after the last one
- Compare transient data with a meta box value
- how to get serialized post meta
- How to left join meta in queries [closed]
- How to run wp_insert_post() & wpdb on the background?
- Register custom table for WP to use in a plugin
- $wpdb->prepare was called incorrectly when inserting multiple records
- How to protect a script execution on WordPress?
- Trying to get variable from WP table and toggle its value
- wpdb->get_row is selecting the variable as a column name
- Set MySQL variables in WPDB
- Use $wpdb or other PHP script method to find/replace in WP database
- get_results query with accent
- CREATE TABLE with dbDelta does not create table
- How can I add a new row in a separate database when someone registers via WordPress?
- Save data from a checkbox to a wpdb array
- How to get specific attribute from DB
- Basic wpdb update question
- WordPress “wpdb->update” – Append Text Value
- How to prepare an array of values with $wpdb
- I can’t update my data through $wpdb
- wpdb Cannot Update column in Database
- Display category names on edit user profile using $wpdb
- Output: “Array”
- Is querying wpdb directly and skipping actions provided by WP’s core “wp_update_post” a good idea?
- How to use mysql LIKE with wpdb?
- PHP -> SQL Query with Summing
- How to insert wp_users ->user login name to wp_terms when a new user registering?
- WP-PostRatings: list current user’s rated posts
- Delete database record using plugin from admin panel
- how to connect to another database in wordpress
- Get unique results from this function
- Need help converting get_user_meta [keys] into own array
- Cannot access $wpdb, comes back NULL
- Wpdb get->results to out the the month from the db
- $wpdb->insert() doesnt work anymore
- $wpdb query outputs php code instead of executing it
- How do I prepare strings for insertions as values into a MySQL table?
- WPDB Join with custom table
- wpdb query not working
- How to use AJAX in WordPress in MYSQL query?
- Getting values from wpdb
- Where can I see MySQL hostname and port for wp-config.php
- Can’t call WPDB inside RSS template
- WordPress wpdb->insert returns int(0) => doesn’t insert anything, no errors!
- Change MySQL PDO connection to a WPDB connection
- WPDB – Read and write value from / to database
- Using “->” in a page to exceute $wpdb query gives error
- $wpdb->get_results breaking page?
- Why is this $wpdb query looping 5 times?
- wpdb query not returning results containing single quotes
- form $_post action value gets truncated after it passes through two forms
- duplicate entries in database while using save_post or wp_insert_post
- Why my query does not run with prepare
- wpdb and acf via wp rest api
- WPDB SQL Ignore `post_status` Parameter
- How to Generate a list of Most Commented post?
- WPDB Table Does Not Exist
- Why won’t this wpdb get_results query return results?
- Save sql file after doing insert wpdb
- WPDB secure custom form
- Unknown column ‘siteurl’ in ‘where clause’ WPDB outside
- Inserting a MySQL record into a table with an array of field names and an array of values
- Incorrect Use of wpdb::prepare()
- Exclude specific terms from all queries using posts_where or something similar
- wpquery properties last_query and last_result : should these be public or private?
- Ascending order of yearly archives [closed]
- foreach loop inside the loop creating duplicates in output
- wpdb getting avatars and author url
- Perform a function when a user clicks register button
- Undefined variable: row?
- Add row to custom database Table and delete all rows older than 1 day
- $wpdb->get_results not returning an array
- Can I use wpdb to insert query results into a post?
- query a newly created table using $wpdb
- Call to a member function get_row() on a non-object, Unable to use global $wbdp inside a plugin
- select a single val though a table in wordpress
- Get all sticky posts from one user through user ID
- WPDB Query Question with Category Only
- WordPress SQL JOIN query
- $wpdb->prepare error after WordPress update [duplicate]
- wpdb result arrray inside an array
- populate select options from extra mysql table data
- Query the links Database
- Fetching review value using wpdb class
- $wpdb->num_rows doesn’t work
- $wpdb->get_var next var?