Jump to content

A little Sql/Php help


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.

Link to comment
https://forums.phpfreaks.com/topic/280966-a-little-sqlphp-help/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.