Jump to content

A little Sql/Php help


dev1902
Go to solution Solved by dev1902,

Recommended Posts

Hello, Can someone help me to come up with a condition for an input to filter out a large table to a smaller table with a code.

 

> My files are already uploaded to my db(database) and I already I already created a code to display the information in a table.

 

> To clarify what i need help with, I populated a text field with information from my db and then when i submit it, it will filter the large table and only include any information that has to do with the information that i submitted.

 

 

>> To further clarify, here is an example : There is a db with usernames, and I populated a text field with all the user ids.

     >> When i select the user id and click 'submit', all the information on that specific user id is pulled up and displayed on another page.

                 --> but there is also an option to display two user ids at the same time.

 

I know how to do it individually like this:  

 

<?php

     $query = mysql_query("SELECT * FROM  `gfr` WHERE numInter > 0 AND geneSymbolTranscript1 = 'ERG'");

?>

 

but, i want to be able to do it for two columns and all their rows.

 

Thanks in advance.

Edited by dev1902
Link to comment
Share on other sites

I know. I was saying, what if i populated a text field with those names on one page, and the i submit that specific name(s) and it displays all the related infromation with that name(s) on another page.

 

You probably don't want a text box, maybe a multiple select box.  If you must use a text box, then you would have to delimit the names with a space or comma or something.  Then you would just explode on that delimiter and implode back into a string lik 'bob','sally' and use that in the IN clause of the SELECT.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.