• Resolved dariotoby

    (@dariotoby)


    Hello sorry I’m a beginner, I’m looking for a way to make a search engine from a mysql table called archivosingoli,
    I have an archive of karaoke bases of 33000 rows and 5 columns (Author, Title, Format, Sinconizer, Date) I would like through two search forms one by Author and one by Title to query this archive and the results by Author or Title come out in a table. I do not understand much of the query I saw this plugin that should do it my way but I do not understand how to do it.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Eli

    (@scheeeli)

    I can’t coach you on creating the HTML search forms that you need but if you understand all that then I think this example query might help you comlete the search results page:

    SELECT blah FROM blah WHERE Author LIKE ‘%<?php $_REQUEST[author] ?>%’

    Then you Save this report with a name and put it on a Page using the shortcode. Then you can submit your author field to that page and get the results.

    There are a lot of steps and plenty of places to make mistakes so I suggest that you start off small and just test each piece individually to make sure you know what works and what doesn’t. You can hard code some variables at first just to get the results that you would expect. Then go back and make it more dynamic and presentable.

    Let me know if you get stuck and where you need more help. The more real examples and actual data you provide, the more I will be able to help.

    Thread Starter dariotoby

    (@dariotoby)

    SELECT my_love4music FROM avwp_archiviosingoli WHERE Autore LIKE ‘%<?php $_REQUEST[Lucio Battisti] ?>%’

    I put the query as you told me, I do not know if I did well instead of blah I put the name of the database for the first blah, for the second blah the name of the table, Autore is the name of the field, and Lucio Battisti it is a result that should find. When I test, he tells me

    Parse error: syntax error, unexpected ‘Battisti’ (T_STRING), expecting ‘]’ in /membri/love4music/wp-content/plugins/elisqlreports/index.php(414) : eval()’d code on line 1

    if I write Lucio_Battisti
    Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘%%’’ at line 1

    Plugin Author Eli

    (@scheeeli)

    Wow, I’m not sure how to begin. It would appear that you don’t know how to write a basic SELECT query and I would suspect that you also don’t know what the $_REQUEST global variable is used for, not to mention that you may not even know how to create an HTML form that will submit your visitor’s quires to the right page. What you want to do is not an easy thing for a non-developer to accomplish. This is complicated and requires an advanced understanding of SQL, PHP, WP, and HTML. If this is where you are getting stuck then I’m afraid that you will need a lot of help to get this done. I cannot teach you all that you need to know to do this on a forum. I would suggest hiring someone who is a web-developer with knowledge of WP and SQL to do this for you. My plugin will only enable you to make this page that you want if you know how to write the query you want and how to use the user input. This plugin was not designed to do what you want and although it could possibly accomplish your end goal it will not be easy and I will not be able to help you learn all the things you need to know outside of my plugin to enable you to finish this on your own.

    I’m sorry if this sounds like a brush-off but I didn’t understand you coding level when you posted your first request and I assumed you could handle the basic stuff and just needed a better understanding of what my plugin was capable of. Please let me know if you think there is anything else I can help with.

    Thread Starter dariotoby

    (@dariotoby)

    you’re right I do not know everything you say I’m helping with tutorials on youtube etc. Thank you for the help you gave me.

    Plugin Author Eli

    (@scheeeli)

    If you want to start off small and see an example of what my plugin can do then try this query:
    SELECT Author, Title, Sinconizer FROM avwp_archiviosingoli

    Once you see this full report, listing all the fields in all rows then you can try removing the columns that you don’t want to see and filtering the rows by adding a simple criteria, like this:

    SELECT Author, Title FROM avwp_archiviosingoli WHERE Sinconizer = ‘some value goes here’

    I have had great success with using an advanced table report tool called (ninja tables). They have a great user interface and elastic text search and multiple filters in various form elements. This tool may be better suited to what your trying to accomplish without the need to learn deeper amounts of html

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘How to make the query’ is closed to new replies.