Q. how get several results from a single column in a recordset using PHP
Hello world
I hope someone can help. I have a column called categories and about 5 categories listed. I want to show all the products listed in say 2 categories. I don't have that basic php skills so know only how to pass a value to the url to display the products of 1 category for example
Select *.
PRODUCT
Category WHERE colname =
$colname = $_GET ['category'];
URL... page.php? category = result
Question is how can I get products in several categories to show for instance all the products of the categories "fruits", "dairy products", 'meat '.
Your help will be much appreciated, because I'm tired of beating my head against the wall. (should invent a pillow of wall PHP and sell online)
Thank you
$colname1 = $_GET ["category1"];
$colname2 = $_GET ["Category2"];
$colname3 = $_GET ["category3"];
Select *.
PRODUCT
Category WHERE the ('$colname1', '$colname2', '$colname3')
> Your help will be very appreciated because I'm tired of beating my head against the wall
My guess is that you are trying to build a web application without first learning the basics of PHP and SQL. It is certainly the hard way.
Tags: Dreamweaver
Similar Questions
-
Several links in the single column
Hello
I have a requirement to display several links in the single column.
Example:
Select emp_name emp #, total_days days, col3, col4 from table
Here, I need to display a link beside the example of days
If day > 100 then display "101 CH" where 101 days value and CH is the URL link which will open a popup page. I can't have another column for the link that we have already several columns. So I need a way to display the link with the value next to him. How can I achieve this?
try to put it in the source of the region
Select emp_name, emp #,.
-case when days > 100 then days | " http://Google.com" target = "_blank" > popup' another to_char (days) end total_days, "
col3, col4 from table;
This should display "101 popup" when the days more than 100, no popup link on days<= 100="" e,g="" "99"="">=>
and the value of the column total_days to the "Reporting Standard column" to allow html tags.
Change the href attribute and formatting to meet your requirement
-
If I type "NBA" in the address bar, I get results from yahoo. I don't want the results of yahoo, I want Google results. This just started today. How can I get Google search results to show after typing in the address bar?
- Type of topic: config in the address bar and press on enter
- Accept the warning message that appears, you will be taken to a list of preferences
- Locate the preference keyword. URL, right-click on it and choose reset
This will restore it to Google.
-
Please tell if it is possible: D because I hate the stuff lol antivirus it slows down my computer please provide related info removal virus with output using an anti-virus and please suggest me some good anti-virus (avast bcz it does not support my system) with a download link
Thanks in advance :)To get rid of the current problem you can restore your system to the State it was before the infection if you have made the system images. Otherwise, see SpiritX advice in How to remove spyware from the computer
You can use Microsoft Security Essentials in the future with an anti-spyware application [many are recommended in other threads].
-
How to import music from a CD on the computer to use for a project in Windows Movie maker.
I've never done this before. How can I put music on a Windows slideshow? How 'import' the songs on the computer so that I can use on the presentation of "film"? This is for my mother's funeral. Thank you.
Hi RJHolmes,
You can check the following items and check if it helps:
Importing files into Windows Movie Maker: frequently asked questions
Import video, photos and audio on Windows Movie Maker
Hope this information is useful.
-
How to navigate through a recordset using PHP
I have a recordset containing a MySql table with 5 columns, each containing an email address of a staff member in a club.
Each line represents a different club and each column a different type of agent.
The first column represents presidents, treasurers next etc...
The recordset is called $mailset.
I need to loop through each row in $mailset and extract the email addresses of each column and concatenate them into a string separated by semicolons semi so it ends like this:
[email protected] ; [email protected] ; [email protected] ; and so on.
This is how the recordset is implemented:
@mysql_select_db ($database_dummyread, $dummyread);
$query_mailset = "SELECT club_chair_email, club_treas_email, club_sec_email, club_delegate_email, club_deputy_email FROM clubs;
$mailset = mysql_query ($query_mailset, $dummyread) or die (mysql_error ());
$row_mailset = mysql_fetch_assoc ($mailset);
$totalRows_mailset = mysql_num_rows ($mailset);
? >
I tried to use a loop to iterate through the Recordset, but it always shows the first record, so its not to move the pointer in the file.
The pseudo code of the punishment to be something like this:
Initialize variables and move to the first record
If the registration process
Read a record
Treat all columns
Move to the next record
on the other
If there is no record
print an error message
on the other
Print the results.
Can someone give me a hint on how to move from one line to the other in a recordeset under the control of a loop.
I use PHP and MySql. (as far as I know, this is the original - not AOP or MySqli)
While ($mail = {mysql_fetch_assoc ($mail_seyt))}
extract ($mail);
echo "$club_chair_email - $club_treas_email".
";}
That should put you on the right track.
-
How to get the result of a single line in several columns
I have a scenario where I asked five different columns in a table and it would still look back one line.
So, for example: the query would be
So, this would mean 1 row with the value of their respective areas.Select user1, user2, user3, user4 from table1 where tblkey= 2
In my code, I have a common function I can call to send an email to the list of people (User1, User2, user3, user4).
So rather than call this function each time for each user, is there a way I can display the output to 4 different rows and use the loop For to call this function only once.
In this way, the loop For running 4 times (if not nulls for all users) and call this function of e-mail.
Really, I'd appreciate if someone could give me an idea of this scenario.
Thank you
ARIf the number of columns is fixed you may be able to use this:
SELECT DECODE ( RN , 1,USER1 , 2,USER2 , 3,USER3 , 4,USER4 ) AS USERS FROM TABLE1 CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4) WHERE TBLKEY = 2
This UN-pivot results.
Here's an example of it in action:
SQL> CREATE TABLE TABLE1 2 ( 3 TBLKEY NUMBER 4 , USER1 VARCHAR2(1) 5 , USER2 VARCHAR2(1) 6 , USER3 VARCHAR2(1) 7 , USER4 VARCHAR2(1) 8 ); Table created. SQL> INSERT INTO TABLE1 2 SELECT ROWNUM 3 , SUBSTR(OBJECT_NAME,1,1) 4 , SUBSTR(OBJECT_NAME,2,1) 5 , SUBSTR(OBJECT_NAME,3,1) 6 , SUBSTR(OBJECT_NAME,4,1) 7 FROM ALL_OBJECTS 8 WHERE ROWNUM <= 10; 10 rows created. SQL> SELECT * FROM TABLE1 WHERE TBLKEY = 2; TBLKEY USER1 USER2 USER3 USER4 -------------------- ---------- ---------- ---------- ---------- 2 I _ U S SQL> SELECT DECODE 2 ( 3 RN 4 , 1,USER1 5 , 2,USER2 6 , 3,USER3 7 , 4,USER4 8 ) AS USERS 9 FROM TABLE1 10 CROSS JOIN (SELECT ROWNUM RN FROM DUAL CONNECT BY ROWNUM <= 4) 11 WHERE TBLKEY = 2 12 / USERS ------------------------- I _ U S
HTH!
Published by: Centinul on February 24, 2010 11:21
-
How can I get good results from the detection of matching/shape of reason for this image?
I need to be able to identify all nine squares in the first image (0000094718...) and others like him. I tried to detect shape, filtering and geometric pattern match. I tried to vary all parameters within these functions. I tried the image preprocessing (and the model, if any: usually created from only one of the boxes) with thresholding and/or a muliplier before using the detection or the corresponding function and I still can not get all nine boxes and only these nine boxes.
Can someone offer some help? Ideally I would be able to use the shape detection, because it returns the coordinates of the corner rectangles and those who are particularly useful to me. What confuses me about this feature, is that after setting the width/height minimum/maximum of rectangles to find, the program seems to ignore these instructions and returns matches outside these limits.
It would be even better to be able to have a script which will identify all nine boxes in two attached images. The boxes in the second image (X820A32) are more square.
Thank you
Holly
Try the attached script. I think that you use only may not be the optimal threshold values. You may find that you want to use a smoothing filter before making the threshold. This should also help with nuisance particles.
-
How to generate several lines from a single line
Hi, using Oracle 11 g R2.
Looking for a way to display the result of a query where a column value is a text similar to the following field. There is only 1 row.
create table testlist (col1 varchar2 (50))
insert into testlist values (' ' 845, 999, ABC ")
The values are always separated by commas. Looking for display the result as follows
845
999
ABC
Hello
Since you have only 1 row in the table, you can do this:
SELECT REGEXP_SUBSTR (col1
, '[^,]+'
1
LEVEL
), Element
OF testlist
CONNECT BY LEVEL<= regexp_count="" (="">=>
, '[^,]+'
)
;
Output:
AGENDA
------------
845
999
ABC
-
How to get the list in a single column in a query
Hello.
I wonder if there is a way to get a query (no pl/sql code) a list of columns with a separator between them.
I know I can get that without separators with an expression of cursor:
But the result I want is (by using the separator ';'):SQL> with test_table as ( 2 select 1 col1, 'a' col2 from dual 3 union 4 select 1 col1, 'b' col2 from dual 5 union 6 select 1 col1, 'c' col2 from dual 7 union 8 select 2 col1, 'a' col2 from dual 9 union 10 select 2 col1, 'c' col2 from dual 11 union 12 select 2 col1, 'd' col2 from dual 13 union 14 select 2 col1, 'z' col2 from dual 15 ) 16 select col1, cursor (select b.col2 from test_table b where b.col1 = a.col1 order by b.col2) col2_list from test_table a 17 group by col1 18 / COL1 COL2_LIST ---------- -------------------- 1 CURSOR STATEMENT : 2 CURSOR STATEMENT : 2 C - a b c 2 CURSOR STATEMENT : 2 CURSOR STATEMENT : 2 C - a c d z
I don't know how to manage a cursor expression without using a pl/sql function block. Can it be done using analytical functions?COL1 COL2_LIST ---------- -------------------- 1 a;b;c 2 a;c;d;z
Thanks in advance.Hello
This is called 'aggregation of chain.
This site:http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2196162600402
shows different ways to do this, including the SYS_CONNECT_BY_PATH solution which gave Blushadow.
I got a lot of use of the first solution on this page, the function defined by the user STRAGG, that you can copy.
Once you have installed STRAGG, your query is simply
SELECT col1 , STRAGG (col2) AS col2_list FROM test_table GROUP BY col1;
The query above do not put items in a particular order.
On Oracle 10 (and more) you can have a similar function, the WM_CONCAT (property WMSYS), already installed.
WM_CONCAT is not documented, so you can't use it in your Production applications. -
How to get several xml elements in a relationship 1: n without using xmlaggregation
I need to create the following xml structure from an oracle database
where each survey can multiple deelnemers (participants)
I'm not sure create this use of XMLElement without getting the message "ORA-01427 subquery returns more then one line."
I could try to use dbms_xmldom (never done that before) but I wonder if anyone knows how to generate this just using the plain Oracle SQL-XMLfunctions (XMLElement, XMLAggr)
< NieuweSurveys >
< survey >
< Surveynaam > 2013 - 02 - 01 < / Surveynaam >
< Months > 2013 - 02 - 01 < / months >
< Einddatum > 2013 - 02 - 15 < / Einddatum >
< Deelnemer >
Tilde < Chairwoman > < / Chairwoman >
< Tussenvoegsel / >
DeelnemerA < Achternaam > < / Achternaam >
man < Geslacht > < / Geslacht >
< Emailadres > [email protected] < / Emailadres >
< Voorkeurstaal > nl < / Voorkeurstaal >
Schouten < account > & Nelisen < / account >
bouwer < function > < / function >
< / Deelnemer >
< Deelnemer >
Tilde < Chairwoman > < / Chairwoman >
< Tussenvoegsel / >
DeelnemerB < Achternaam > < / Achternaam >
Vrouw < Geslacht > < / Geslacht >
< Emailadres > [email protected] < / Emailadres >
< Voorkeurstaal > nl < / Voorkeurstaal >
Schouten < account > & Nelisen < / account >
Tester of < function > < / function >
< / Deelnemer >
< / inquiry >
< / NieuweSurveys >
What is your version of the database? (SELECT * FROM version$ v)
The query does not match the output that you claim that it produces.
In any case, the problem is the following:
) as "deelnemers.
Put an alias here should not generate an element - unless you are using XMLForest in your actual query without your telling us.
That's why I ask about the version of db, it could be an old bug that's been fixed now (I have not to reproduce the behavior on 11.2).
What happens when you delete the alias?
-
Why do I get several files from office?
For some reason any in the folder owner, I not only my real desktop folder, but also another folder named "Desktop". If I open this folder, I have another folder with the name "New folder" and in this case, I have another office. Whenever I try to remove excessive workstations, I get a message saying I don't have permission. Sometimes it allows me to remove them, but them I can't use my office more: everything is frozen and I can't click on anything whatsoever. I really want to know what is happening and how to solve the problem.
Hello
· Since when are you seeing multiple office files in the system?
· Are you able to boot to the desktop normally?
Method 1:
Step 1:
I suggest you to start in safe mode then do a system restore to the previous point, when the system worked very well and see if the problem is resolved. Follow the steps mentioned below to start in safe mode.
a. restart the computer and keep tapping F8 until you reach the start menu.
b. Select safe mode in boot options and press ENTER.
Follow step 2 to do a system restore.
Step 2:
See the article mentioned below to do a system restore.
System Restore: frequently asked questions
http://Windows.Microsoft.com/en-us/Windows-Vista/system-restore-frequently-asked-questions
Method 2:
I suggest to create a new user account and check if the problem persists. Follow the steps mentioned in the article below.
Create a user account
http://Windows.Microsoft.com/en-us/Windows-Vista/create-a-user-account
Thanks and regards.
Thahaseena M
Microsoft Answers Support Engineer.
Visit our Microsoft answers feedback Forum and let us know what you think. -
How to display several numbers in a single column in same PO?
How can I display multiple receipt of a single purchase order numbers in the same area?
Check this box...
Select pha.segment1 po_num
, rtrim (xmlagg (xmlelement (e, rsh.receipt_num |))) ') .extract ('/ / text()'), ',') enames
of rcv_shipment_headers rsh
rcv_shipment_lines rsl
po_headers_all pha
where rsh.shipment_header_id = rsl.shipment_header_id
and rsh.creation_date between (sysdate-20) and (sysdate)
and rsl.po_header_id = pha.po_header_id
Pha.segment1 group
-
several actions from linking single action
OBIEE 11.1.1.6
I have a column in an analysis that I had to put a link to action on the link to a Web site, it's something I can do. However the data returned in the column is one of the two types of Type A or B, if it is of type that I want to link to the Web site A and Type B I want to link to site B. I want to create a link simple action that is going to the site A or site b according to the values in the column. I can create an individual to either site has action link or B and add a condition, but I can't think how to add a unique action link that will dynamically to a Web site or the other based on the value of the column. Is this possible?
Published by: K Chumpski on November 27, 2012 07:05Hello
You can navigate to several links of action action unique bond based on the conditions...check if useful/correct...
Thank you
prassu -
I need to transfer a voltage using a PXI-5421 signal before a Council of PXI-2576 and then transfer it to an another Committee of the PXI-2576. For example I had set the signal of the ARB has then put 16 CH MUX 1(1st Switch), the value CH MUX 3 0 (switch 2) then read the MUX 3 voltage using a PXI-4071. I know that I can use the example of DMM Switch Handshaking.vi niSwitch for the rear. I'm just not sure how to transfer data to MUX 1, MUX 3?
Thank you
Denise Barajas
Hi Denise,
You must connect two switching modules to the outside. Signals may not actually be transferred through the PXI chassis backplane. Bottom of basket can only be used for communication by PCI bus and for the delivery of the trigger. You need to use external threads to physically send the signal of the first PXI-2576 to the second.
There are two ways to connect signals to the PXI-2576, you can use a block of endings that mounts to the front of the module PXI, or you can use a cable with a block of external connection. You can then connect the signal cables to the connectors to screws on the terminal/connector block. More information about the options of connection to the NI PXI-2576 connectivity products Page.
Hope this helps!
Chris G
Maybe you are looking for
-
recently sent mail messages are missing, AddressBook compromised
Latest hotmail messages in my 6 months sent mail folder disappeared. I had added a fictitious address in my address book to work as a "trap" to show if big message has been sent to all. She returned as a message rejected at the same time, that the
-
Problems with media player 11 and all other players, playing music is broken?
Problems with media player 11 and all other players, playing music is broken? Hi all I have a big sound even and odd / problem reading music? My computer using windows media player 11 and classic media windows and others to play my music in the hard
-
Windows Media Player does not display
I seem to have Windows Media Player installed (it worked fine a few months ago) now I can't view any .exe file on the screen, I click. When I go to download a new copy to install the installation reads: you already have the latest version of Windows
-
I get an error 19 error disc recorded on disk, of raidxpert and my computer crash guard
HPe-112y is my computer and I get errors raidxpert. Lately IE 19 recorded on disc disc error, any help would be greatly appreciated
-
6500 a E710 using iPad AirPrint printing problems
I have a 6500 a E710 and saved for Web Services. I have firmware CIP1FN1048PR. When you print from iPad with AirPrint, I only see the printer for a while and then it disappears and I get a message "No Printers Found". I was not able to print corre