Thursday 15 January 2015

php - Getting output from a query with an implode function in it -


I am trying to determine whether a combination of topics related to the forum is unique. When adding topics to a forum, this is done by specifying this code and query:

  $ options = array (); // Here are your options $ [] = 'Balablaabla'; $ Option [] = 'Bala'; Forex currency ($ option as $ key = & gt; $ value) {echo '& lt; Li & gt; . $ Value '& lt; / Li & gt; '; } $ Sql_unique = "SELECT Forums_ForumID, from the list (select topic_formamid, group_concat (topics_price)) from the list (select topic * subject to topic_crosstable ORDER subject by TopopicID) by H group forum_foramID) WHERE list = (SELECT GROUP_concat (TopicID) "; $ Sql_unique. = Implode (", ", $ option); $ sql_unique. =") Order by Forum_FORMID ASC "; $ Result = mysql_query ($ sql_unique); // print "$ Result"; // resonance results $; // echo mysql_num_rows ($ result); // $ assoc = mysql_fetch_assoc ($ result); Var_dump ($ result);   

I'm sure that the query works fine when using defined values ​​in WHERE. I can not get any output with the current code. Verdump results do not matter to 'liars' if the theme combination is unique or not. I'm trying for days now, so I can help you really help me! thank you in advanced!

If you are a string then you have to quote your options.

  $ sql_unique = "'". Implode ("','", $ option). "'";    

No comments:

Post a Comment