Passing multiple ID's in URL variable

11-30  Source: Network gathering  Views:0 

Advertisement
How can I show results from a mysql database from selected ID's using URL variables?
Showing results from one ID works fine:
mypage.php?id=1
But,
My table has 10 rows and I want to show 3 of those rows:
mypage.php?id=1&id=3&id=4
Thanks for a point in the right direction.
Are any of you original participants in this thread still around? I'm a bit of a "Jack of all trades, master of none" and I'm having a hell of time. I'm pretty sure this post relates to what I'm trying to do, but I'm just starting in dynamic site building with PHP and I can't seem to translate this situation into my situation.
What I'm trying to do is set up a series of menu items for categories of merchandise (rugs), with subcategories for size. I've succeeded in making links where the user can choose ALL sizes within a category and (separately) I've succeeded in making links where the user can choose a size within a specific category, but I'm not able to create links where the user can choose a specific size OR see all sizes out of a single menu.
Here's what I've got:
3 tables: products, categories & size
The size table has 2 columns - sizeName, and SizeID - the sizeID column is an integer and it links to products table.
The categories table also has 2 columns - categoryName and categoryID - the categoryID column is also an integer which links with the product table
I also built a menu with categories, and each category has a drop down menu where the viewer can choose a size.
Each size link has a parameter which includes the categoryID as well (in following example, all the sizes are within one category):
small - products.php?categoryID=8&sizeID=1
medium - products.php?categoryID=8&sizeID=2
large - products.php?categoryID=8&sizeID=3
On the receiving page (products.php) I created a recordset which looks like this (I'm looking at the recordset dialog box within Dreamweaver CS4):
SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
FROM products
WHERE categoryID = colname AND sizeID = varSize
ORDER BY price ASC
the variables look like this:
Name: colname
type: Integer
default value: -1
Runtime value: $_GET['categoryID'}
Name: varSize
Type: Integer
Default value: 1
Runtime value: $_GET['sizeID']
(Dreamweaver created colname and I created varSize. I'm not really sure why the default values are as they are).
This works, but it doesn't give the "all sizes" option. So I've tried applying what I saw in the thread, by creating this link instead:
products.php?categoryID=8&sizeID=1&sizeID=2&sizeID=3
In the recordset I created the new variables like this (all as integers with 1 as default value):
varSmall = $_GET['sizeID_1']
varMedium = $_GET['sizeID_2']
varLarge = $_GET['sizeID_3']
And I wrote this code:
SELECT price, `description`, categoryID, largeImage, smallImage, sizeID
FROM products
WHERE categoryID = colname AND sizeID = varSize
OR
WHERE categoryID = colname AND sizeID = varSmall AND sizeID = varMedium AND sizeID = varLarge
But within the recordset dialog box, I hit the test button and I got a message about a syntax error.
Am I anywhere near the solution? Any help would be greatly appreciated.
Thanks,
Dave
Related articles
  • Passing multiple ID's in URL variable 11-30

    How can I show results from a mysql database from selected ID's using URL variables? Showing results from one ID works fine: mypage.php?id=1 But, My table has 10 rows and I want to show 3 of those rows: mypage.php?id=1&id=3&id=4 Thanks for a point

  • How can i pass multiple values by a single variable to EXECUTE IMMEDIATE 10-11

    Hi All, I want to pass multiple values for where condition for execute immediate. Something Like this:- bold Declare v_cond varchar(1000); Begin v_cond := '''INR','USD'''; --(OPTION 1) v_cond := 'INR,USD'; --(OPTION 2) EXECUTE IMMEDIATE 'Delete from

  • Pass multiple query strings to url using HTTPWebRequest 10-11

    I'm trying to read data from API (in Json format) and load it into SQL server using script task in SSIS. Dim Request1 As System.Net.HttpWebRequest = DirectCast(System.Net.HttpWebRequest.Create(URL), System.Net.HttpWebRequest)         Dim Object1 As [

  • Dynamic list to generate url variable 10-11

    Hello, I am using a dynamic list to pull product codes from a database. I then want to pass the code into a url variable when it goes to the results page. This is so customers can chose which code they want to go to a detail page about. I already hav

  • How to pass multiple values to a single parameter in BW report URL 10-11

    Hi Experts, I am new to EP and learning .... i am stuck at one point where we need to pass multiple parameters to a BW report URL, this is the URL that we launch from BSP.... Suppose i have to pass different multiple values to a single parameter, how

  • Can you pass an array URL variable 10-11

    Hi, Doing a form which I want to validate, then re-display with error messages and the keyed data still in place should there be errors, or go onto a second form if all ok. I have tried to use <form action="<?=$_SERVER['PHP_SELF']?>" bu

  • How to passing multiple values for a parameter of discoverer(url parameters 10-11

    Hi All, I am trying to pass multiple values for a parameter of disco report. I am trying to include my url for discoverer viewer report. the values has the following 'jeff,mark' 'sfophiee,angela' Thanks and Regards VenkatHello Venkat, I know there ar

  • How to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part 10-11

    Hi, I want to pass multiple query string values using the same parameter in Query String (URL) Filter Web Part like mentioned below: http://server/pages/Default.aspx?Title=Arup&Title=Ratan But it always return those items whose "Title" value

  • Oracle BI Publisher - Passing multiple wildcard search to a bind variable 10-11

    Hi, Please help me in resolving the below mentioned issue: I have developed a report in oracle BI Publisher with a SQL query. While scheduling the report to run I used to pass mutilple parameters like CGAMSVC08,RLCSVC51 If the pass the parameter with

  • How To Pass Multiple Parameters In URL with Report Builder 10-11

    Hi, I use apex 4.2 with database xe 11g and i use report builder to build my report i use this link to call report function runrep(){ var vurl = 'http://192.168.0.57:8889/reports/rwservlet?userid=retail/[email protected]&destype=cache&desformat=PDF&paramfo

  • Pass WebI dimension multiple values to OpenDocument URL lsM parameter 11-30

    Hi Has anyone managed to pass multiple values of WebI dimension object to OpenDocument URL lsM parameter? My WebI document has 3 objects: Country  \[Country\] and Customer \[Customer\] dimensions and Sales Amount measure. WebI report includes a table

  • Passing URL variable on login redirect 11-30

    I first want to say thank you for all the great help I have received on these forums over the past couple months - it has been very helpful and saved me countless days. Saying that, I do have another problem. I would like to pass a URL variable to th

  • Passing multiple values for a single field in URL to call sap Transaction 10-11

    Hi All, I need to pass multiple values for a single field to SAP transaction . means if i have say a field "Date" which can contain more than one value, <b>but its not a range which has two fields</b> . How is it possible. Let me kno

  • How To Pass Multiple Parameters In URL 11-30

    Hi All, I have a requirement to pass two paramaters to the URL which is expected to open a report with filtered data. The context is, I have two reports 1. mainreport 2. subreport. The mainreport provides a link ( which is TestcaseId ) which on click

  • URL. variable persisting across submit() 11-30

    Hi, I have a wierd problem that affects only one script of dozens that use the same technique. I have apage with two forms. The first form displays a select lisst of players in our basketball club. When selecting a player the page is reloaded using o

  • Unable to get URL Variable 10-11

    I've seen many posts about URL Variables, and I've tried implementing the solutions, but nothing seems to be working, so I'm hoping that someone out there might be able to help me with my situation. I have built a JSP page in JDeveloper. The page mus

  • Passing Multiple Values from Multi Select 10-11

    Hi, My requirement is simple. I have created a simple Multi Select Option in parameter form and i want to send multiple selected values from the multi select option (in parameter form) to reports. eg: I want to send multiple countries code as input .

  • Passing multiple session values from cold fusion into a flash movie 10-11

    Hello all, I know that to pass multiple variables into a flash movie you could use the embed tag like this(with the & between each variable): <embed flashvars="variable1=value1&variable2=value2" ></embed> Now to pass a single

  • How to pass multiple values from workbook to planning function ? 10-11

    Hi, I have created Planning function in Modeler and it has one parameter(Variable represents = Multiple single values). When executing the planning function by create planning seq. in the web template : I see value of variable store data like ...    

  • How to bind/pass multiple input parameters to sql query in BPEL Process 10-11

    Hi, I have a requirement to invoke a query on a database table to fetch the records based on the few input values or bind variables? I have created a Partner link using the DBAdapter service and have used custom SQL, how can i bind and pass multiple