Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have created a booking form on front-end, and there is also "confirm my booking" page.

once you submit your booking form. and it stored on "booking" custom post and saved post meta (such as phone number, time.. etc)

But I can't figure out how to get the result when people do "confirm my booking".

When users put their's "name, phone number" on confirm page, I have to show other information.

I can't get the query or wordpress functions...

this might be the same sql query.

"select name, phone, time, day, howmany from booking_table where phone=$strPhone and name=$strName"

This is what I need on confirm result page.

Thanks for your time.

share|improve this question

1 Answer 1

I understand your problem but in your question your going from submission of a form to querying data you expect in the database then displaying it. That covers a lot of steps.

My first question is have you confirmed that your submitted form values are being stored as you expect? We need to rule out data insertion being the real problem rather than SELECT and displaying the information.

I would Google "WPDB" which will help you find a page dealing with queries using the $wpdb object. If you have not already written your SELECT query and especially if you haven't finished or complete your INSERT or UPDATE queries as you really need to think about security.

You should then post your queries here.

share|improve this answer
    
1question: yes all of them are stored well. I am not sure "rule out" means. all of them are stored on post-meta with each keys, values. for update, I used " update_post_meta($visa_post_id, '_Name1', $_POST['name1']); " for insert, I used "wp_insert_post($post);" for titles, contents... I will search for WPDB and get you back when If I find anything about it. Thanks, –  pulla Aug 17 '13 at 7:58
    
Well this is the page you may need then... codex.wordpress.org/Template_Tags/get_posts. If you look near the end and find Taxonomy Parameters. You will see how to create a query that gets your post based on specific meta. So you would add your phone and name as meta key. Add your $strPhone and $strName as the values much like shown on that page. So $posts = get_posts($atts); and your $atts array will pass an array to meta_query. –  WebTechGlobal Aug 17 '13 at 20:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.