Answer the question
In order to leave comments, you need to log in
How to retrieve data from Wordpress database?
Hello!
I have a table in a db created by me, it stores some data. How to make a request correctly in order to display data in the required fields. Now I do this:
$vdusersdataemail = $wpdb->get_var("SELECT user_email FROM wp_vd_users WHERE user_login = '".$_SESSION['login']."'");
<input type="text" name="email" value=" echo $vdusersdataemail; " class="custom-text grey-text" />
Answer the question
In order to leave comments, you need to log in
Read the documentation , or something ... Well, or at least open the class and see what public methods it has. $wpdb->get_var()
is to get one particular value. $wpdb->get_row()
- to get the entire string. $wpdb->get_results()
- more general, generic, for obtaining any results. $wpdb->query()
- in general, to fulfill any request.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question