Retrieving information from a database


(Pedro Perdomo M.) #1

On my server I have a SQL database with scientific articles. The fields are publication number, date, article title, author and keywords.
I need a way for the user to do a search based on any or all fields and get the title or titles of the articles that meet the search criteria. By clicking on the title the full text is displayed.

I wonder what is the best way to achieve this, and if there is a stack or widget appropriate for such purpose.

I hope that makes sense. Sorry for my English.

Many thanks in advance

Best


(Peter Danckwerts) #2

StackApps or Kuler’s SQL stacks


(Pedro Perdomo M.) #3

Peter, thank you very much for your prompt and kind response. I have both sets of stacks, but I feel intimidated to use for my lack of experience.

Kuler’s stacks seems to be easier to use for me, but I find no documentation. I have reviewed some videos and I understand the basics, but I have no knowledge to fill, for example, the php query that appears under the warning. (please see picture).

Moreover, in the Kuler’s website example , the link points to an external page. In my case I need the full text of the article is displayed in another area of my page, but not creating a page for each article, but importing from the DB.

I wonder if you can recommend me where to learn something more.

Best regards

PS: there is no option to upload images to the forum right now


(Karn Broad) #4

Hi,

You’ll need to post a given number of times before you can post images as far as I know. Put an image in your Dropbox and send us a link if you need to - hopefully you can post links! (maybe leave off any http bit)

Might be worth a question to Kuler to see if the type of display you want is something the add on is designed for or not if your idea is that different to their examples.

I’d love to help you with PHP, but to say that’s not my strong point would be a total understatement!

With best regards,
Karn.


(Peter Danckwerts) #5

I must admit that I’m very rusty on MySQL myself but the basic syntax is quite simple. For example, if you had a table called members containing membership details and you wanted to select all members whose surname was Smith, just type SELECT * FROM members WHERE surname = 'Smith';


(Pedro Perdomo M.) #6

Hi Karn, is very strange, because I had posted images before. Here is the Dropbox link. https://dl.dropboxusercontent.com/u/625762/Screen%20Shot%202015-10-31%20at%2011.06.30%20p.m..png
Let me try to contact Gary (Kuler’s stacks).

Many thanks for your kindness

Best


(Pedro Perdomo M.) #7

Thank again Peter,
On my replay to Karn you can see the image.

Best


(Dale Levesque) #8

Hi P, I’ll take a stab at this one. Personally I would use the following stacks:

Bryn Owen: LinkList Stack to create multiple buttons in order to create your variables. For example you want to use a button or form component to indicate whether any or all fields are to be included in the search. Then use the return values to concatenate into your SQL string to provide your mysqli_query call.

Use the Kuler SQL Base Pro Stack or even just an HTML stack to create the SQL query string. Make sure to select all the text and press “command”+"." to handle the quotes issue. Then use <?php echo $recordset['fieldname']?> in any text container your using to display your results. Hope this makes sense, I kind of winged it.