There is a database in it there is a table wp_bp_xprofile_data . There is a column in this table with values

alt text

You need to select only the data in which there is an id2 value.

alt text

You need to select using this script:

 sql-driver-connection=jdbc\:mysql\://домен/Bukkit?user\=логин&пароль\=fun sql-query=SELECT name FROM wp_bp_xprofile_data WHERE name\='<%value%>' 

I know that I need to add here

 sql-query=SELECT name FROM wp_bp_xprofile_data WHERE name\='<%value%>' 

But how to do it, I do not understand, I ask for help.

  • At first I could not understand what screenshots were at these addresses. Is the name of the table more difficult to write than to make a screen with the name? - Oleg Arkhipov
  • one
    Rewrite the question, please text. “... table wp_bp_xprofile_data , in this table there is a column field_id with integer non-unique values. It is necessary to select only the data in which the value stands [ here I did not understand by what criteria and what you want to choose, explain yourself ] ” - drdaeman
  • Any cons can deliver. I explain. It is necessary to select from the data table wp_bp_profile_data certain data (field_id) with value 2. In the line value "any text" - Nikita Aristarkhov
  • So. Nothing is clear again. What you have to choose is, in fact, should be unknown, otherwise it is not interesting to choose. And where does the value? (And what does this generally mean, a column?) If you need to select all the values ​​in the value column, for rows where field_id is 2, then for example: SELECT value FROM wp_bp_xprofile_data WHERE field_id = 2 . - drdaeman
  • one
    SELECT name FROM wp_bp_xprofile_data WHERE name='...' does not have practical meaning, since The known value for the name is selected. It is like “to deduce the names of all people whose name is Vasya”. - drdaeman 5:53 pm

2 answers 2

SELECT * FROM wp_bp_xprofile_data WHERE field_id = 2

If not all columns are needed, but one (or several, but not all) - instead of “ * ”, substitute their names, separated by commas. For example: SELECT value FROM wp_bp_xprofile_data WHERE field_id = 2

Conditions in WHERE are combined via AND . If you need to select a value with field_id = 2 for a specific user, then SELECT * FROM wp_bp_xprofile_data WHERE field_id = 2 AND user_id = 123 .

( sql-driver-connection=... sql-query= omitted everywhere for readability)

    Lol Shield? I do not understand your speech! What kind of script do you have for choosing, I do not know. The operation of selecting data under a certain condition from the database is very simple. For example, I need to display all the logins of my users, if they have chosen from the cities of Moscow.

     include ("bd.php"); $result = mysql_query("SELECT login FROM users WHERE pole='Moscow'",$db); //извлекаем логин и идентификатор пользователей $myrow = mysql_fetch_array($result); do { //выводим их в цикле printf("<a href='page.php?id=%s'>%s</a><br>",$myrow['id'],$myrow['login']); } while($myrow = mysql_fetch_array($result)); 
    • It is necessary exactly as in php, I know. sql-driver-connection = jdbc: mysql: // domain / Bukkit? user = login & password = fun sql-query = SELECT name FROM wp_bp_xprofile_data WHERE name = '<%%%' ' - Nikita Aristarkhov
    • what is name? - LordySL