 
	
		
		
		
		
			
- 
		AuthorPosts
- 
		
			
				
April 2, 2020 at 8:44 pm #1200291I have a problem with my queries. If I add ‘AND’ to concatenate more WHERE clauses my page doesn’t work anymore. 
 Here an example:$services= $wpdb->get_results("SELECT * FROM wp_misano_services AS s INNER JOIN wp_misano_places ON s.id_place = wp_misano_places.id WHERE s.id_language=$language AND wp_misano_places.name=$test_name"); foreach($servicesas $example){ echo $example->services1; //this doesn't work } $services= $wpdb->get_results("SELECT * FROM wp_misano_services AS s INNER JOIN wp_misano_places ON s.id_place = wp_misano_places.id WHERE s.id_language=$language "); foreach($servicesas $example){ echo $example->services1; //this works but gives me too many results }How can I resolve my problem? April 6, 2020 at 7:03 pm #1201316Hey paoluccimarketing, Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :) Best regards, 
 VictoriaApril 6, 2020 at 9:40 pm #1201389So WordPress & Enfold don’t support the word “AND” in sql_query? April 8, 2020 at 5:52 am #1201771Hi, What is the usual value assigned to the $test_name variable? AND wp_misano_places.name=$test_name");Is misano_services a custom post type or a database table that you created manually? Best regards, 
 IsmaelApril 9, 2020 at 9:47 am #1202177Hi Ismael, 
 misano_services is a database table that I created manuallyApril 10, 2020 at 5:42 am #1202567Hey! We would like to ask the following question again. What is the value assigned to the $test_name variable? AND wp_misano_places.name=$test_name");Best regards, 
 IsmaelApril 13, 2020 at 8:09 pm #1203337Hi Ismael, 
 I’m sorry, I didn’t see you first question. However I resolved my problem with nested query. Thanks anyway.April 14, 2020 at 3:35 pm #1203624Hi paoluccimarketing, Glad you got it working for you! :) If you need further assistance please let us know. Best regards, 
 Victoria
- 
		AuthorPosts
- The topic ‘SQL Query Problems’ is closed to new replies.
