Correct and secure way to access a custom SQL database in a custom PHP template file
Correct and secure way to access a custom SQL database in a custom PHP template file
Correct and secure way to access a custom SQL database in a custom PHP template file
An SQL query to find orphaned image attachments and their meta
It should be with capitalized FOREIGN KEY (reg_user_id) REFERENCES wp_users(ID)
Speed up search query that searches in post meta?
Is this what you are looking for? DELETE FROM jnkdadb7a_usermeta WHERE meta_key=’X’;
If you make the changes directly through SQL you won’t trigger the order change event and that’s why the email is not being sent. Instead of changing order via SQL you need to use some predefined function like update_status : $ord = new WC_Order($ID); //ID of the order $ord->update_status(‘completed’)
Use mysql_real_escape_string() instead mysqli_real_escape_string. For more information CLICK HERE mysqli_real_escape_string ($link ,$source ) // $link is your connection variable
I figured out the fix on my own, after many try and errors. I just change this line of code: $status = wp_create_user( $username, $password, $email ); to this: $status = wp_insert_user( array (‘first_name’ => $first, ‘last_name’ => $last, ‘user_pass’ => $password, ‘user_login’ => $username, ‘user_email’ => $email, ‘phone’ => $user_phone, ‘role’ => ‘subscriber’ ) … Read more
Improving performance of SQL sub-queries in WordPress
If you just want the ID of the requested post within the template, get_queried_object_id() will give you that. If you want to modify the main query SQL before it’s executed, there are a number of filters that let you directly modify the SQL.