Filter 2 URL parameter UNION joined table columns

_Hi chaps,

I have a code, which I can't seem to work, think I'm missing something somewhere.

I want to access the two tables and filter them by column "FK_projid", which is located in a URL parameter "id".

$colname_rsJobs = "-1";
If (isset($_GET['id'])) {}
$colname_rsJobs = $_GET ['id'];
}
@mysql_select_db ($database_conndb2, $conndb2);
$query_rsJobs = sprintf (")
(
SELECT
tbl_jobs. FK_projid,
tbl_jobs. JobID,
tbl_jobs. JobName,
tbl_jobs. FK_langid,
tbl_languaget.langtname,
tbl_jobs.jobshipped
Of
tbl_projects
INNER JOIN tbl_jobs
ON tbl_projects.projid = tbl_jobs. FK_projid
INNER JOIN tbl_languaget
ON tbl_languaget.langtid = tbl_jobs. FK_langid
)
UNION
(
SELECT
tbl_jobxml. FK_projid,
tbl_jobxml. JobID,
tbl_jobxml. JobName,
tbl_jobxml. FK_langid,
tbl_languaget.langtname,
tbl_jobxml.jobshipped
Of
tbl_projects
INNER JOIN tbl_jobxml
ON tbl_projects.projid = tbl_jobxml. FK_projid
INNER JOIN tbl_languaget
ON tbl_languaget.langtid = tbl_jobxml. FK_langid
)
("WHERE FK_projid = %s", GetSQLValueString ($colname_rsJobs, "int"));

$rsJobs = mysql_query ($query_rsJobs, $conndb2) or die (mysql_error ());
$row_rsJobs = mysql_fetch_assoc ($rsJobs);
$totalRows_rsJobs = mysql_num_rows ($rsJobs);

I get the error:
You have an error in your SQL syntax; consult the manual for your version of the MySQL server for the right syntax to use near 'WHERE FK_projid = 3525' on line 32


3525 is correct, but I do not know what prevents the code to work... ideas?

I did have the chance to look at, but you have your select statements wrapped in parens. Try to remove those. Also, you have applied only where clause the the second statement of the Union. Is that what you want?

Tags: Dreamweaver

Similar Questions

  • How do I display values skyrocket in the IR filter for the joined table columns?

    Hello

    I have a problem in the IR the query is based on a table, joined with other tables. I would like to provide users the ability to use IR filter search bar in the joined table columns. The problem facing on this filter, the Expression field, by pressing the arrow button displays values for the fields in the primary table, but not for fields that come from joined tables. Have you experienced this behavior in your reports? Is this normal?

    TIA

    Hello

    Correlated subqueries can improve performance - but it does not depend on the involved tables, the number of columns and the existence of indices. As far as I know, the optimizer has problems with them. You could try to explain the Plans on the two statements to verify that.

    In any case, I created a new test page with the SQL for IR:

    SELECT E.EMPNO,
    E.ENAME,
    D.DEPTNO,
    D.DNAME,
    E2.EMPNO "EMPNO2",
    E2.ENAME "ENAME2"
    FROM EMP E, EMP2 E2, DEPT D
    WHERE E.EMPNO = E2.EMPNO(+)
    AND E.DEPTNO = D.DEPTNO(+)
    AND E2.PRIMARY_EMPLOYEE(+) = 'Y'
    

    http://Apex.Oracle.com/pls/OTN/f?p=267:226

    As far as I can see, it works properly - except that if I do a filter on the ename column, when I try to create a second filter, drop-down lists ename all the values, while the other columns list only the available values after having applied the first filter. Which seems strange that the filters are applied as ANDS. But it does the same thing for other areas - IE, the field used in a filter is not filtered for the second filter - so I guess this is normal, but only a person in Apex could probably explain why it is so.

    Otherwise, everything seems to work as I expect and the above page works the same as my test page, which uses external joins http://apex.oracle.com/pls/otn/f?p=267:224

    Andy

  • Works with tables/columns of the lines and the parameter names... syntax help

    I am trying to create a function that returns the distinct value and counts of a user defined schema/table/column.

    The code below defines a [stats_on_column_obj] object type and creates a single table of this type [stats_on_column_tab].

    The function is supposed to take three input variables: p_schema_name, nom_table_p, p_column_name and return an array (above).

    I can hardcode a select into (the)... but once I try to convert it into settings & immediate exec I'm stuck. The red section is where the problem is (I think).

    Oracle 10g.

    Stats_on_column_obj CREATE TYPE IS OBJECT (

    COL_VAL VARCHAR2 (500),

    NUMBER OF COL_VAL_CNT (7)

    );

    CREATE TYPE Stats_on_column_tab IS TABLE OF stats_on_column_obj;


    FUNCTION to CREATE or REPLACE get_STATS_ON_COLUMN

    (

    p_schema_name IN varchar2,

    nom_table_p IN varchar2,

    p_column_name IN varchar2

    )

    RETURN STATS_ON_COLUMN_tab

    IS

    l_STATS_ON_COLUMN_tab STATS_ON_COLUMN_tab: = STATS_ON_COLUMN_tab ();

    n INTEGER: = 0;

    str_select_tbl varchar2 (5000);

    BEGIN

    str_select_tbl: = 'SELECT'. p_column_name |' as col_val, count (*) as col_val_cnt FROM ' | p_schema_name |'. ' || nom_table_p: ' group of ' | p_column_name;

    FOR r IN (str_select_tbl)

    LOOP

    l_STATS_ON_COLUMN_tab. EXTEND;

    n: = n + 1;

    l_STATS_ON_COLUMN_tab (n): = STATS_ON_COLUMN_obj (r.col_val, r.col_val_cnt);

    END LOOP;

    RETURN l_STATS_ON_COLUMN_tab;

    END;

    /

    [Error] PLS-00103 (124:4): PLS-00103: encountered the symbol "LOOP" when expecting one of the following numbers: * & - + / at rem rest mod.. < an exponent (*) > | multiset year DAY_

    [Error] PLS-00103 (126:9): PLS-00103: encountered the symbol "=" when expected in the following way: constant exception < an ID > < a between double quote delimited identifiers > double Ref table Fedya Chariot of time timestam

    [Error] PLS-00103 (127:29): PLS-00103: encountered the symbol "

    [Error] PLS-00103 (128:4): PLS-00103: encountered the symbol "END" when waiting for one of the following numbers: begin function package pragma procedure subtype type use < an ID > < a double quote delimited identifier > form

    SELECT * FROM TABLE (get_STATS_ON_COLUMN ('SCHEMAS_X', 'TABLE_X', 'COLUMN_X'));

    Scott@ORCL > CREATE OR REPLACE
    FUNCTION get_STATS_ON_COLUMN () 2
    3 p_schema_name IN varchar2,
    4 nom_table_p IN varchar2,
    5 p_column_name IN varchar2
    6                                )
    7 STATS_ON_COLUMN_tab of RETURN
    8 EAST
    9 v_STATS_ON_COLUMN_tab STATS_ON_COLUMN_tab: = STATS_ON_COLUMN_tab ();
    10 v_n INTEGER: = 0;
    11 v_str_select_tbl VARCHAR2 (5000);
    BEGIN 12
    13 v_str_select_tbl: = ' SELECT stats_on_column_obj (' | p_column_name |) ', Count OF ' |
    14 p_schema_name | '.' || nom_table_p | "Group of" | p_column_name;
    15 v_str_select_tbl EXECUTE IMMEDIATE
    COLLECTION IN BULK 16
    17 IN v_STATS_ON_COLUMN_tab;
    18 RETURN v_STATS_ON_COLUMN_tab;
    END 19;
    20.

    The function is created.

    Scott@ORCL > select *.
    2 from table)
    (3 get_STATS_ON_COLUMN)
    4                                            'SCOTT',
    5                                            'EMP',
    6                                            'JOB'
    7                                           )
    8                       )
    9.

    COL_VAL COL_VAL_CNT
    -------------------- -----------
    CLERK                          4
    SELLER 4
    PRESIDENT 1
    MANAGER 3
    ANALYST 2

    Scott@ORCL >

    Or better change function in the pipeline.

    SY.

  • URL variable for two tables...

    I am a beginner and assume the task to convert a MS access database to a Web site. Im having an issue trying to do what I want to do and hope that someone can give me advice.

    I have 2 tables, 1 this customer information host and one that has customer notes as a relationship 1:M. I want to create a master/detail page, where the details of the page has information on customers AND all notes associated with the client. The question that I have is little matter how to create the type of PHP document I can't display the correct information and absoultely have no idea how to phrase the question looking for him.

    I thought I could try to use the master page and link the two URLS and load simultaneously into the details of the page, but I did not go to him. Any direction would be MOST appreciated.

    I'll take a shot at this, maybe from a slightly different angle. First of all, in your notes table, you need a record ID, unique to each note. Then you must key anforeign that connects the user to the note. It seems that you have this way of drawing, but I can't say for sure. On the master page, you see the list of users in the region of repetition as expected? If you, you also need a field to create you link to the details page. You may have already done this, but I'll go through the steps. Enter text in this field such as "view details.". Select the text and using the fielder icon search and select the detail page. Do not close the window and click the settings button. Enter a name for the setting, and remember, as username. For the value, click the lightning to make appear the dynamic elements. The Recordset, select the field that corresponds to the FK in the secondary table, I think you are using the single recordID parameter for the client. Say ok in all windows to close. On the detail page, all you need is a simple recordset. In simple mode, select the table, filter it on the URL parameter' ' equals, select the FK column and enter the name of the variable exactly the same thing as what you named him for the link (UserID). This will create a reforest notes only for this customer. Where you place notes, add a rep to the region to display them all. If you also want to display the data in the customer table, you can create a select query with a JOIN, or to make it really simple, just create another set of records using the same setting but use the customer rather than the notes table table.

  • Several items with the PHP URL parameter

    Hi, I am a novice PHP, using dreamweaver only do any programming. I have a page showing 10 products, and within each product, I have a checkbox dynamic named "checkbox" which is linked to the product id. When the user selects multiple checkboxes, I want to display the results on the results page by using a URL parameter. I can get the page to send the url like this:

    CheckBox.php? CheckBox = 100000 & Case = 100100 & box = 100200 & box = 100300 & box = 1010 23Submit = Submit

    I can't figure out how to get more than one display item. I searched and read countless forum entries, but nothing I can work with.

    Here is the form on the home page;
    < do action = "checkbox.php" method = "get" name = "checkbox" > "
    < input type = "checkbox" name = "checkbox" value = "<?" PHP echo $row_rs_products ["Item"];? ">" / >

    On the checkbox.php page, the recordset is:

    SQL: SELECT *.
    PRODUCTS
    WHERE Item = 'products '.
    ORDER BY point CSA

    Variables:
    name of column-$1 _GET ['checkbox']

    Any help is appreciated.
    Thank you
    Roger

    huntlok1 wrote:
    > I get the page to send the url like this:
    >
    > checkbox.php? checkbox = 100000 & = 100100 checkbox checkbox = 100200 & checkbox = 100300 & che
    > ckbox = 101023Submit = Submit
    >
    > I can't figure out how to get more than one display item.

    It's like saying: I'll have a beer. No, I'm getting red wine. No, I'll
    have a cherry brandy. Uh, no, make it a flaming lamborghini.

    Each variable must have a different name. Otherwise, the last one being always
    WINS.

    Since you're using PHP, change the name of your boxes something
    like products []. The empty pair of brackets turn products into
    a table. In your page, you must then activate the table in
    something that your recordset can use.

    > On the checkbox.php page, the recordset is:
    >
    > SQL: SELECT *.
    > From products
    > WHERE Item = 'products '.
    > ORDER BY point CSA

    $products = implode (',', $_GET ['products']);

    SELECT *.
    PRODUCTS
    WHERE point IN ($products)
    ORDER BY point CSA

    --
    Adobe Community Expert David Powers
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    Author, "PHP Solutions" (friends of ED)
    http://foundationphp.com/

  • What is the table/column name for group of segments data

    Hello!

    I'm looking at the specific table/columns that contain the values for the segments of people group by assignment. Well want to can someone tell me.

    Thank you.

    Jon

    Join the pay_people_groups with per_all_assignments_f with the people_group_id of the column

  • DOUBLE join table

    What happens if we want to join table DOUBLE with another table?

    Gul says:
    What happens if we want to join table DOUBLE with another table?

    Not really would you use an equi-join on double because it will always contain a single row and column. Cartesian double with one of the tables will result in the same set of rows, which is at the Table.

    When we get the same result from Tables, why do we use double then?

    Double table is just a convenience table which is / was used to extract the sequence next/Currval, in order to calculate the level of generation etc. Dates missing to know. For more information of the Table double, please read the thread from Tom Kyte. Everything about Table double.

  • TypeError: Error #2007: url parameter must be non-null - HELP!

    Hey everybody. I (as well as everyone who posts a question here) am quite new to AS3. If I'm going crazy trying to figure out what is the cause of this error. I have a "jukebox" player that loads songs accordingly when the button is clicked. BUT it's my mistake:

    TypeError: Error #2007: url parameter must be non-null.

    to flash.media::Sound/_load()

    to flash.media::Sound/load()

    at lesson09_V2_S5_fla::MainTimeline/frame1()

    And here is my code:

    Import fl.events.SliderEvent;

    create instances of the three sound related classes that will be used for this project

    var snd:Sound;

    var channel: SoundChannel;

    var trans:SoundTransform;

    create variables to store the values for the power of the song and its volume and pan settings.

    var currSong:String;

    var currVol:Number is. 5;

    var currPan:Number = 0;

    Table of all songs in the current playlist.

    var songList:Array = new Array ("nothing on You.mp3","Grenade.mp3","Ride.mp3","Pretty Girl Rock.mp3","Tick Tock.mp3", "Dynamite.mp3");

    don't need to see the volume and pan controls until a song

    panSlide.visible = false;

    volSlide.visible = false;

    Headphones for the buttons of the song on stage

    song1.addEventListener (MouseEvent.CLICK, chooseSong);

    Song2.addEventListener (MouseEvent.CLICK, chooseSong);

    song3.addEventListener (MouseEvent.CLICK, chooseSong);

    song4.addEventListener (MouseEvent.CLICK, chooseSong);

    song5.addEventListener (MouseEvent.CLICK, chooseSong);

    song6.addEventListener (MouseEvent.CLICK, chooseSong);

    headphones for the volume sliders and pan

    panSlide.addEventListener (SliderEvent.CHANGE, panChange);

    volSlide.addEventListener (SliderEvent.CHANGE, volumeChange);

    sets the text of all the buttons of the song field to display the names of the songs in the songList array

    for (var i = 0; i < songList.length; i ++) {}

    var str:String = [i] songList have thong;

    Str = str.replace(".mp3","");

    var clip = this ["song" + (i + 1)] .title;

    clip. Text = str;

    }

    statement to define a song based on the song button was clicked switch.

    function chooseSong(e:MouseEvent):void {}

    Switch (e.currentTarget.name) {}

    case "song1:

    currSong = '... /MP3s/ ' + songList [0] as String;

    break;

    case "song2":

    currSong = '... /MP3s/ ' + songList [1] as String;

    break;

    case "song3":

    currSong = '... /MP3s/ ' + songList [2] as String;

    break;

    case "song4":

    currSong = '... /MP3s/ ' + songList [3] as String;

    break;

    case "song5":

    currSong = '... /MP3s/ ' + songList [4] as String;

    break;

    case "song6":

    currSong = '... /MP3s/ ' + songList [5] as String;

    break;

    }

    }

    If (snd! = null) {}

    Channel.Stop ();

    }

    SND = new Sound();

    SND. Load (new URLRequest (currSong));

    snd.addEventListener (IOErrorEvent.IO_ERROR, onError);

    function onError(e:IOErrorEvent):void {}

    Do nothing

    }

    Channel = new SoundChannel;

    TRANS = new SoundTransform (currVol, currPan);

    Channel = snd.play ();

    channel.soundTransform = trans;

    panSlide.visible = true;

    volSlide.visible = true;

    currVolume and pan values are used here for display in the text beside the sliders fields

    volLabel.text = "Current Volume" + int(currVol * 100);

    panLabel.text = "Current Pan" + int(currPan * 100);

    listen to the arrival of ID3 tags

    snd.addEventListener (Event.ID3, id3Handler);

    triggered when the id3 tags are available

    sets the info text field to display the information of the current song from id3 tags.

    function id3Handler(event:Event):void {}

    var id3:ID3Info = snd.id3;

    If (id3.songName! = null) {}

    songTitle.text = id3.songName + "\n";

    info. Text = "" Artist: \n"+id3.artist+"\n \n ";"

    info.appendText ("Album: \n" + id3.album);

    info.appendText ("\n\n" + "available at: \n" + "passionrecords \n.com");

    }

    }

    var format: TextFormat = new TextFormat();

    format.font = "Arial Black";

    format. Color = 0xFFFF00;

    format. Size = 14;

    format.url = " " http://www.passionrecords.com/ ";

    info.defaultTextFormat = format;

    uses the value of volume slider to control the volume

    function volumeChange(e:SliderEvent):void {}

    currVol = e.target.value;

    volLabel.text = "current Volume:"+ int(currVol*100); "

    TRANS.volume = currVol;

    channel.soundTransform = trans;

    }

    uses pan value of the slider to control pan

    function panChange(e:SliderEvent):void {}

    currPan = e.target.value;

    panLabel.text = "Current Pan" + int(currPan*100);

    TRANS. Pan = e.target.value;

    channel.soundTransform = trans;

    }

    Any help would be greatly appreciated! Thank you!

    This looks to another case of code not be placed where it should be.

    If this code is not in a function, then it executes immediately when the program starts.  At this point, snd is not defined, no said.  You do not create the instance until the line... snd = new Sound();   that, I believe, you have now moved inside a function.

    You might have to go through all the code to see what parts you always floating around this need of houses inside functions.

  • Dealing with a URL parameter to be used for a default value

    I have a page of results of detail (the CONTACTS Table Recordset), identified by the CONTACTID

    In the same page, I also have another dynamic relational table, showing all the associated notes that contact record (recordset CONTACTNOTES identified using CONTACTS. CONTACTID = CONTACTNOTES. NOTESCONTACTID)

    It works fine and I can update CONTACTS without any problem.

    My problem is to insert a new record CONTACTNOTES (of a simple URL link) also associated with the same record.

    The primary field (NOTEID) is an AutoNumber but I need to carry out CONTACTS. CONTACTID variable to use as the default value for the CONTACTNOTES url. NOTESCONTACTID.

    I think something like that...

    in the dynamic table on the initial results page, using (/ insertnote.php?) CONTACTID = <? PHP echo $row_recordlookup ["NOTESCONTACTID"];? >) as the link, setting the URL parameter.

    The page insertnote has a recordset insert form, related to the CONTACTNOTES table.

    Now, I don't know how to add this URL parameter as the default field value. Is it as simple as putting the $HTTP_GET_VARS ["CONTACTID"] in the field of the Init val in the property inspector?

    Sorry - worked on...

    On the new page of note insertion, I first created a Recordset, duplicate on the initial results page.

    When you create the form, it was easy then to insert {CONTACTS. CONTACTID} as a default value.

  • How to get the names of the table columns in the quick dashboard

    How to get the names of the table columns in the quick dashboard


    Thanks and greetings
    ------------------------
    Kishore P

    Make a prompt like:

    SELECT case when 1 = 0 then 'D0 time. " "" T02 by month name "other" 'D2 market' '. "" M04 region' ' the end 'Sample Sales' UNION ALL SELECT case when 1 = 0 then 'D0 Time. " "" T02 by month name ' else ' 'Time D0. "" T02 by month name ' ' the end 'Sample Sales.

    Put the name of column in single quotes.

    Make your rank as a function:
    Rank ('F1 income'. "" Recipes 1-01 (after all) "by @{pColumn} {'D0 time'. ({"" T05 annually name '})

    It works fine for me

    concerning

    John

    http://obiee101.blogspot.com

  • by the way the date in url parameter criteria

    Hello

    I want to filter a recordset before a certain date.
    Create the Recordset, if I use a value of execution of 27 November 06 # all records for this date are returned.
    However, when I try to spend the same information through the URL parameter it does not work.

    Is there a problem with this info by the way like this?

    Thank you, Mark.

    Not to be absoloutely fine. The problem is most likely to do with your SQL
    statement.

    A test are not all records. At the top of your page, try
    output from the SQL statement finished on the page to see what it looks like
    as. The problem is, you may need to add the symbols # manually. Expected
    look like

    "SELECT * FROM TableName WHERE DateField = #" & URLParameter & "#".

    HTH,

    Piers

  • Value of the URL parameter with: do not display correctly on the page

    Hello

    I'm working on a page with an interactive report. One report column is a hyperlink to another page (Page deletion). This link goes to an id and a title page delete such as its poster a confirmation message to the end user before to actually delete it. If the title contains a ': ' the text after the ":" is not displayed on the page (visible in the URL on top)

    Is it because that the ': ' separates parameters in a URL to the APEX and, therefore, the text after the ': ' is considered to be the following URL parameter?
    How can we solve this problem?

    Kind regards
    Priya Jetley

    A solution should be not only not to work with the parameters in the URL.

    Simply a process to pass values from one page to another as is:

    BEGIN
    IF: REQUEST = 'TEST' THEN
    P2_ID: = P1_ID;
    P2_TITLE: = P1_TITLE;
    END IF;
    END;

    In this case, your problem is solved, and it is safer because the user does not see what id is passed and can not manually put the id in the URL...

  • DB connectivity Kit: syntax error in a SELECTION of data from joined tables

    Hello everyone

    I'm putting in labview a SQL query on joined tables.

    As an example I take a database to store the data of basketball 2on2 matches, which tables are

    corresponds to (matchId, Thomas, teamB)

    teams (teamId,PlayerAname, PlayerBname, nationality)

    nationalities (NatId, natName)

    To get an array of result with the game as well as the names of player as well as their nationality, I use this query on MySQL (which works on command line interface)

    SELECT MatchID,
    T1. PlayerAName, t1. PlayerBName, n1.natName,
    T2. PlayerAName, t2. PlayerBName, n2.natName
    MATCHES m
    INNER JOIN teams t1 ON t1.teamID = m.teamA
    INNER JOIN teams t2 ON t2.teamID = m.teamB
    INNER JOIN nationalities L1 ON n1.natID = t1.nationality
    INNER JOIN nationalities n2 ON n2.natID = t2.nationality

    When I put it in labview, using the block 'select data', I get a syntax error as shown in the attached screenshot.

    Am I something mistanking using the JOIN examples statements or aliases?

    Thanks in advance!

    The select VI is designed to be a simple way to select from a table. I doubt that he can do joins (and would not certainly need the 'FROM', even if it can). What you can do instead calls the query execute VI and give him the complete SQL query. I don't remember if it returns the data in the recordset object, so you must do so separately.

  • Create table 2d by pulling larger 2d table columns, as indivated by an array of Boolean

    Hello

    I have a 2d chart with 16 columns that contain data from different input channels.  I also have a 1 d array of Boolean (length 16) corresponding to these columns.  In the table of Boolean 1 d, if a value is true, I want this column in table 2d to stay.  If the value in the table of Boolean 1 d is wrong, I want to delete the corresponding column.

    Thus, for example, if the table of Boolean 1 d looks like this:

    [T T T T F F T T T F T T F F T F]

    the new 2d array would be 10 columns, which correspond to the columns of the old 16-column of table 1, 2, 3, 4, 7, 8, 9, 11, 12 and 15.

    I am very new to labview (programming just started yesterday). Can someone help a newbie to do something that is probably simple? In my view, that there will be an iteration back through the deletion of rows and 16 columns table columns as they come if the value of the Boolean vector is false, or iterate forward through the 16 columns and add columns to a table if the value of the Boolean vector is true... but I don't know how to do this.

    Thank you

    Matt

    If you have 2012 you could just do this:

    -Ryan S.

  • Put a % sign in a label (Table column)

    Hi all

    I created a very basic dashboard of the percentages of availability for the service display.  The default (medium) label appears as availability average reference (%):

    I changed it has something a little more meaning to our customer:

    However, it would be good to put in something like percentage of availability of Service (target 99%), but I can't get the % symbol to display.  I tried to use the backslash % (-%) to comment out a special meaning, but it does not work and the default label is displayed instead.  Does anyone know how to display a "%" symbol in a table/column label?  I also tried a double backslash, double percentage, single and double quotes, brackets...

    Thank you

    Brian

    I took an additional screen shots. It is the foglight 5.6.7 version. Note the label for the column.

Maybe you are looking for