Wordpress PHP quiz - code to recall answer recalls all past submissions as well -


Excuse me, if the answer to this question is indiscriminately clear, do I just start learning php? Do not believe me 100% on what I am doing.

Iâ € ™ ve made a quiz that the user fills on WordPress using the plugin FSQM Pro and when they submit it, it is redirected to a page that answers any questions in the quiz Will display some text with They offer whatever the answer to miss them, I've used this code:

  & lt; Php global $ wpdb, $ ipt_fsqm_info; $ Form_id = 9; $ Data_ids = $ wpdb- & gt; Get_col ($ wpdb-> Ready ("select ID FROM {$ ipt_fsqm_info ['data_table']} where form_id =% d", $ form_id)); Forex (as $ data_ids $ data_id) {$ data = new IPT_FSQM_Form_Elements_Data ($ data_id); Echo wpautop ($ data-> data-> pinfow [13] ['value']); }? & Gt;   

However, when I execute it, then it gives all the values ​​that the user has entered for that question with the most recent value given below.

How do I get it only in the production of value most recently?

OK, you can modify your MySQL query ORDER BY And LIMIT sections, such as:

$ data_ids = $ wpdb-> Get_col ($ wpdb-> ready ("SELECT id FROM {$ ipt_fsqm_info ['data_table']} WHERE form_id =% id ID DESC LIMIT 0,1", $ form_id));

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -