• Let me try to explain what exactly I want to do.

    I want to set up a function where someone who wants to sell a ticket can fill out a form (name, asking price, game, etc) and submit it.

    Secondly, I want someone who wants to buy a ticket to search for available tickets by GAME or ASKING PRICE, etc., using the data that the previously seller posted.

    Simply, I want a form that stores into a database. Then someone can search that database using another form.

    Any help would be greatly appreciated!!!

    Thanks!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You’re going to want to make a new table to store this stuff. You will want two forms of course, and two handlers to handle the form submits. The form and handler can be the same PHP page, which process executes depends on if the request is GET or POST. All of this should be contained in a plugin. As long as the table is in the WP database, you can use $wpdb methods to insert and search data.

    Pages that are directly linked to that interact with WP and it’s DB need to require once the wp-admin/admin.php page, assuming all users of the page should be logged into the system. Even low capability users need the admin.php page required even though they cannot do any admin tasks. It just ensures they are logged in. If being logged in is optional, require once wp-load-php instead.

    There’s lot’s more detail of course. I suggest you start by creating a simple form that stores data in a table you manually created with phpMyAdmin. Once you get that working, start adding more functionality and improving the appearance. If you get stuck along the way, you could always come back here. Good luck, and have fun!

Viewing 1 replies (of 1 total)
  • The topic ‘Form that searches a database (or alternative method)’ is closed to new replies.