Help table two MySQL

I need find a user and display its details if it is another user on the friends list.

I have a table user with user_id, user_fname, user_sname etc... and a table of friends with friend_id, ur_id, their_id, approved

I have a called ajax script php to auto fill key function by pressing the letters that match the query.

This is the query:

SELECT user_id, user_fname, user_sname, user_city, photo, e-mail users, friends WHERE ur_id is "$_SESSION [user_id] ' AND user_fname LIKE ' % $queryString2% ' OR user_sname LIKE ' % $queryString2%»

It seems to get all the values and double rooms when I use this method, I don't think I can use a left join because I can't put the user_id and ur_id on the other.

Please can someone help me with this?

Thank you.

Yes I saw this, but that only checks a table for a certain value (value of $_SESSION ["user_id"]).

But when you pull the data in the second table, you need to match a common value between tables, which in your case is user_id.

It will take the data in table 2 If user_id of the 2nd table is same with the 1 user_id of tables.

Tags: Dreamweaver

Similar Questions

  • Table service MySQL DATA FREE

    How can I activate the FREE option of DATE for the Service of Table of MySQL?

    Thank you

    You can enable by default on Metrology for resources in one of the following two ways:

    Individually by clicking on the 'Metric data' tab next to the tab indicators when you view monitoring data.  From here you can ' metric Show more "and select the settings that you want.

    In the world by going to Administration in the header, and then "followed by default.  Find the MySQL Table service that interests you and click on "change the metric models."  From there, you will present a similar screen that will apply to any changes to all existing and future of such resources.

    -Ryan

  • How to import the selected tables from MySQL to Oracle

    Hello world:

    How can I import tables from MySQL to Oracle? I have more than 180 tables in my DB (MySQL), but I copy only 12 of them to ORACLE... rigth now I do it manually, using SQL Developer (rigth clicking on the picture icon and copy to Oracle) but now I need to do this automatically every 4 hours...

    I read on the dblink option, but I don't know if this is the best for this case...

    I appreciate all help.

    Best regards
    Jack

    Hi Jack,

    I think that with a db-link you can define an automated task (PL/SQL + programmer).
    We use a db-link to Oracle's RDBMS to MySQL. So we have no experience.
    We have created the db-link like http://www.pythian.com/news/1554/how-to-access-mysql-from-oracle-with-odbc-and-sql/

    Heike cordially

  • CFScript to create tables (using MySQL) and configure it to use InnoDB

    I use a cfscript to create my database and the tables using MySQL, and I was able to DO this with success, accept that I'm having a problem. I want to put my tables use InnoDB instead of MyISAM. How to do this?

    That's what I did:

    < cfquery = 'test' datasource name = 'mydatasource' >
    CREATE TABLE Test
    (
    Id int (11) NOT NULL auto_increment,
    Name varchar (20) default NULL,
    Tinyint (4) active default NULL,
    PRIMARY KEY (Id)
    ); ENGINE = InnoDB DEFAULT CHARSET = latin;
    < / cfquery >

    But when I get an error when I run this script. That's what I get:

    -You have an error in your SQL syntax; "check the manual for your version of the MySQL server for the right syntax to use near '; ENGINE = InnoDB DEFAULT CHARSET = latin1'.

    I look and it's the right syntax. Any ideas what I am doing wrong?

    Thanks for any help

    Alfie

    Nevermind, I figured it. I misspelled it.

    ENGINE type = InnoDB... must be before the semicolon.

    :)

  • With the help of two tables

    As part of my game, I want to have two paintings, a source from the list of words and one holding the clues. What I intend to do, is to randomly generate a Word as well as the idea to this word. I've got the word generator works correctly, but I don't know how I can make a separate table, choose a clue. That's what I have so far as present to the array of words to work:

    Var words: Array = ["LONDON", "CYPRUS", "CHINA"];

    It's my table of words

    number = (Math.floor (Math.random () * 3));

    inProgress = words [number];

    wordLength = inProgress.length;


    That's what I use to generate the word randomly. Note: the number is a variable number, I created and inProgress is a string variable, that I created.

    I would like to know how I can do randomly generate the index at the same time, using the table:

    var indices: Array = ['Capital of England', 'Small island', more 'high population'];

    If it makes it easier to see all of the code for this I'm going to paste below for you to see. Thank you!

    Var words: Array = ["LONDON", "CYPRUS", "CHINA"];

    var number: number;

    var inProgress: String = new String;

    var wordLength:Number;

    var myDisplay: Array = new Array();

    displayOut var: String = new String;

    var rightCount: number = 0;

    used var: String = new String;

    Guess var: String = new String;

    var guessLetter: String = new String;

    var correctGuess: Boolean = false;

    number = (Math.floor (Math.random () * 3));

    inProgress = words [number];

    currentClue = indices [number];

    wordLength = inProgress.length;

    for (var i = 0; i < wordLength; I ++)

    {

    myDisplay [i] = ' * ';

    displayOut += "" + myDisplay [i]

    }

    var answerText:TextField = new TextField();

    var myFormat:TextFormat = new TextFormat();

    myFormat.font = 'Segoe UI symbol';

    myFormat.color = 0X00FF00;

    myFormat.size = 23;

    addChild (answerText);

    this.answerText.x = 375;

    this.answerText.y = 40;

    this.answerText.width = 250;

    this.answerText.text = displayOut;

    answerText.setTextFormat (myFormat);

    Use a textfield and assign the index as text of this property.

    clueTextField.text = indices [number];

  • help sql two queries toload target table

     
    create table table1 
        (code varchar2(10)
         ,mod_time date);
         
         insert into table1 values('2533',to_date('31-JUL-2012', 'DD-MON-YY'));
         insert into table1 values('2534',to_date('31-JUL-2012', 'DD-MON-YY'));
          insert into table1 values('2535',to_date('01-SEP-2012', 'DD-MON-YY'));
        
          create table table2
        (code varchar2(10)
         ,ID   NUMBER
         ,TYPE VARCHAR2(3)
         ,mod_time date);
         insert into table2 values('2533',1,'AB',to_date('01-SEP-2012', 'DD-MON-YY'));
         insert into table2 values('2534',1,'CD',to_date('01-SEP-2012', 'DD-MON-YY'));
         
         create table table3
         (ID   NUMBER
          ,mod_time date);
          insert into table3 values(1,to_date('01-SEP-2012', 'DD-MON-YY'));
          insert into table3 values(2,to_date('01-SEP-2012', 'DD-MON-YY'));
          
          create table target
          (code varchar2(10)
          ,ID   NUMBER
          ,TYPE VARCHAR2(3)
          ,table1_modtime date
          ,table2_modtime date
          ,table3_modtime date
          ,valid_till  date 
          ,valid_from  date 
          drop table target
          
          combine all the three tables where table1.mod_time<=31-jul-2012, table2.mod_time<=31-jul-2012,table3.mod_time<=31-jul-2012
          
          initial load to target load should be get the information from all the tables modtime<=31-jul-2012
          Need to have select query to get the below 1st load expected output
          valid_till defaults to to_date('31-DEC-2030', 'DD-MON-YY')
          valid_from defaults to to_date('01-01-1995', 'DD-MON-YY')
          
         1st load expected output
          code    id     type  table1_modtime   table2_modtime      table3.modtime  valid_from valid_till   
          2533                 31-JUL-2012                                                            01-01-1995  31-DEC-2030  
          2534                 31-JUL-2012                                                             01-01-1995   31-DEC-2030  
          -------------------------------------------------------------------------------------------------------
    for the second charge. first get the query to get the values of all tables
    mod_time > 31 July 2012.

    If the code exists then update the existing record with valid_till in January 2, 2013 IE yesterday
    and insert a new record with the new values and valid from date to January 3, 2013 IE today
        --------------------2nd load expected output  
          code    id     type  table1_modtime   table2_modtime      table3.modtime      valid_from     valid_till
          2533                 31-JUL-2012                                                               01-01-1995       02-jan-2013 --updating old record valid-till to yesterday
          2534                 31-JUL-2012                                                               01-01-1995       02-jan-2013  --updating old record valid-till to yesterday
          2533      1     AB   31-JUL-2012        01-SEP-2012        01-SEP-2012         03-jan-2013  31-DEC-2030----updating old record valid-from to today
          2534      1     CD   31-JUL-2012        01-SEP-2012       01-SEP-2012          03-jan-2013  31-DEC-2030--updating old record valid-from to today
          2535                  01-SEP-2012                                                              01-01-1995  31-DEC-2030 --no record exist so insert new record in target table
          --------------------------------------------------------------------------------------------------------
      
    Published by: Daniel on January 3, 2013 17:01

    Hello

    Just check the data that you have inserted in the tables, because trying to join the table and put the date constraint its no return value

    select T1.CODE as code ,t3.id as id ,t2.type as type  ,T1.MOD_TIME as table1_modtime ,T2.MOD_TIME as table2_modtime ,T3.MOD_TIME as table3_modtime from table1 t1, table2 t2,table3 t3 where T1.CODE = t2.code and t2.id = t3.id
    and t1.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')
    and t2.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')
    and t3.mod_time<=to_date('31-jul-2012', 'DD-MON-YY')
    

    And that's because for code 2533 and 2534 in table1, the id entry in the table2 is 1. but the entry in table 3 for Id 1 is 01-SEP-2012, falling out of date. Please confirm on this data entry in table2.

  • Loop PHP through 2 tables of MySQL?

    Manu chaps,

    I have a bit of PHP code, that loops through a table MySQL (jobs) and displays all the records that were not complete. The code and the MySQL Query work fine.

    I want to know is whether the query can be modified to perform a loop on 2 tables.

    Here's my current query:


    @mysql_select_db ($database_conndb2, $conndb2);
    $query_rsJobs ="
    SELECT
    tbl_projects.projID,
    tbl_projects.projtitle,
    tbl_jobs. JobID,
    tbl_jobs. FK_projid,
    tbl_jobs. JobName,
    tbl_jobs. FK_langid,
    tbl_languaget.langtname,
    tbl_jobs.jobpages,
    tbl_jobs.jobshipped
    Of
    tbl_projects
    JOIN IN-HOUSE
    tbl_jobs
    ON tbl_projects.projid = tbl_jobs. FK_projid
    JOIN IN-HOUSE
    tbl_languaget
    ON tbl_languaget.langtid = tbl_jobs. FK_langid
    WHERE
    tbl_jobs.jobshipped =' no
    ORDER BY
    FK_projid ASC";
    $rsJobs = mysql_query ($query_rsJobs, $conndb2) or die (mysql_error ());
    $row_rsJobs = mysql_fetch_assoc ($rsJobs);
    $totalRows_rsJobs = mysql_num_rows ($rsJobs);

    Here is my table that displays the results:


    < table >
    < b >
    Title of the Document < td > < table >
    Language < td > < table >
    < Table > < td > pages
    Edit < td > < table >
    Delete < td > < table >
    < /tr >

    <? PHP
    $previousProject = ";
    If ($totalRows_rsJobs > 0) {}
    Show if recordset not empty
    While ($row_rsJobs = {mysql_fetch_assoc ($rsJobs))}
    If ($previousProject! = $row_rsJobs ['prices']) {}
    for each project, see the project ID
    ? >

    < b >
    < td > <? PHP echo $row_rsJobs ["PROJID']? > < table >
    < /tr >

    <? PHP $previousProject = $row_rsJobs ["PROJID"]; } ? >

    < b >
    < td > < a href = "jobsheet_details.php? id = <?" PHP echo $row_rsJobs ["IDTravail"];? > & amp; proj = <? PHP echo $row_rsJobs ["PROJID'];? > "> <?" PHP echo $row_rsJobs ['jobname'];? > < /a > < table >
    < td > <? PHP echo $row_rsJobs ["langtname"];? > < table >
    < td > <? PHP echo $row_rsJobs ["jobpages"];? > < table >
    < td > < a href = "jobsheet_edit.php? id = <?" PHP echo $row_rsJobs ["FK_projid"];? > & amp; job = <? PHP echo $row_rsJobs ["IDTravail"];? > "> edit < /a > < table >"
    < td > < a href = "jobsheet_remove.php? id = <?" PHP echo $row_rsJobs ["FK_projid"];? > & amp; job = <? PHP echo $row_rsJobs ["IDTravail"];? > "> delete < /a > < table >"
    < /tr >

    <? PHP} while ($row_rsJobs = mysql_fetch_assoc ($rsJobs));? >
    <? PHP} / / show if recordset not empty? >

    < /table >

    And finally, this is the query that I need to add to my current request to show the resutls of the two tables:


    @mysql_select_db ($database_conndb2, $conndb2);
    $query_rsJobTrans ="
    SELECT
    tbl_projects.projID,
    tbl_projects.projtitle,
    tbl_jobtransline. JobID,
    tbl_jobtransline. FK_projid,
    tbl_jobtransline,
    tbl_jobtransline. FK_langid,
    tbl_languaget.langtname,
    tbl_jobtransline.jobpages,
    tbl_jobtransline.jobshipped
    Of
    tbl_projects
    JOIN IN-HOUSE
    tbl_jobtransline
    ON tbl_projects.projid = tbl_jobtransline. FK_projid
    JOIN IN-HOUSE
    tbl_languaget
    ON tbl_languaget.langtid = tbl_jobtransline. FK_langid
    WHERE
    tbl_jobtransline.jobshipped =' no
    ORDER BY
    FK_projid ASC";
    $rsJobTrans = mysql_query ($query_rsJobTrans, $conndb2) or die (mysql_error ());
    $row_rsJobTrans = mysql_fetch_assoc ($rsJobTrans);
    $totalRows_rsJobTrans = mysql_num_rows ($rsJobTrans);
    ? >


    I don't know if it's possible and tried it myself but seem to get a little bit of mess, since both tables use a foreign key to the projects and language tables, any help would be most appreciated!

    Add tbl_jobtransline to the query and join the other two tables? What exactly is the problem?

  • How to join two tables to retrieve the data from the columns in table two. Tables have primary and foreign key relationships

    Hello

    I want to join the two tables to retrieve the data from the columns of the two table passing parameters to the join query. Tables have primary and foreign key relationships

    Details of the table

    Alert-1 - AlertCode (FK), AlerID (PK)

    2 AlertCode-AlertDefinition-(PK)

    Help, please


    ----------

    Hi Vincent,.

    I think that you have not worked on adf 12.1.3.  In adf 12.1.3 you don't have to explicitly create the association. When you create the EO to your table, Association xxxxFkAssoc, will be created by ADF12.1.3 for you automatically. Please try this and do not answer anything... You can also follow the links below. I solved the problem by using the following link

    Oracle ADF Guide step by step - Oracle ADF tutorial: creating a relationship of the master / detail using Oracle ADF

    ---

  • Need help to load MySQL results in a query

    Hello, I need help to find out why my component of the tree is not being filled with the results of MySQL.

    I have a table of categories:
    ParentID - CategoryID - name

    Each top-level category has a ParentID of 0 (zero). I use php and a recursive function to build an array of results nested, then returning these results to Flex, making these results, a new collection of ArrayCollection, then assign that to the dataProvider of the tree.

    Result: my tree component is empty

    Suspicion: there must be a way with how my table is formed in PHP. If I play with how forms can I get strange results in the tree, so I know that's not a problem with the data passed to Flex.

    I enclose the PHP code used to form table and the output of the table being created

    Hi, thanks for the response. I discovered what the problem was. Table indexes should start with 0 instead of 1. I don't know why that is, but that solved my problem.

  • Need help with two questions about preinstalled WXP Tecra A11 - 10F

    Hello world
    hope someone will help me with these:

    1. sometimes left port my A11 USB and eSATA port close do not recognize any device I plug.
    In win7 there is a power management option with which this can prevent to met, but how can I do under XP?

    2 - is there a way I can put a fixed amount of RAM on the graphics accelerator? (The two o/s)

    Thank you in advance.

    Alessandro

    Hi Alessandro,.

    1. as far as I know that this option is not available on Windows XP. Vista and Windows 7 provide several obsolete as XP power management features. All you can do is to install Toshiba Power Saver if it s not installed. Here, you can set power saving for the processor, cooling fan, etc., but USB is not available.
    In your case, I'll try an update of the chipset driver.

    2. No, fixed the amount of RAM can t graphics card game. This will be controlled automatically.

  • can I insert a column of table in mysql?

    Hello

    I have a long column of table of numbers. I use labsql to connect to mysql.

    When I was a number, I change my channel number and then concatenate it with commands insert to insert my mysql table number.

    now, I want to insert a long column of numbers to mysql, but it is difficult. because for there needs to like before.

    can I insert this table in the form of lots and without recourse to a 'for' and as fast as possible?

    Best regards


  • With the help of two channels of my 6623A

    Hey there, I'm looking for help reguarding a power supply HP 6623 A DC using Labview 9... I'm working on a project where I need to control all 3 channels of power and switch back and fourth to change their output. I tried to change the code in the example, but it will only be 1 channel and clear the other. I can't get the two simultaneously. Thanks for your help

    OK, let's take a step back.

    You control a single instrument.  Therefore, you shoud have only 1 resource that is initialized once and closed once.  You must perform initialization before your loop and close after the loop.

    What I recommend here, is that you use a Structure of the event for the control when you send commands.  The idea here is that you only send orders when your settings change really.  You can use the case of timeout to make the statements.

    And since you claim that you're new, here are some tutorials that you may find useful.

    Introduction of 3 hours
    Introduction of 6 hours
    Bases LabVEW
    Paced self-study for students
    Self Paced Training beginner to advanced, required SSP
    LabVIEW training Wiki
    OR learning
    Getting started with products OR

  • With the help of two GPIB-ENET/100 boxes with ibconf - gpib1 selection?

    I hope this is the right forum for this post.

    I'm trying to use ibconf on Solaris to configure a workstation to use 2 boxes GPIB-ENET/100.  I have never tried to configure a computer to use multiple boxes GPIB-ENET/100 at the time, so I don't have a lot of confidence that I'm doing it correctly for two boxes.  Especially given what I describe below.

    According to the manual page 4-2 of the "Getting started with your GPIB-ENET/100 and NOR-488.» 2 for Solaris. "

    To identify your GPIB-ENET/100 in ibconf, perform the following steps:
    1. press on to select the option rename.
    2. type the alias name of host, host name, or IP address assigned to your
    GPIB-ENET/100 and press .
    3. press to exit, chooose to save your changes.

    I followed these steps for both boxes, but the banner at the top of the menu always says 'Card device for Council gpib0' and he always says "gpib0" just to top the host name that I go.  Shouldn't he State gpib0 first Board and gpib1 of the Committee on the second?  But I don't see a way to move to gpib1, or the unit of the second box ("Board") map.  Instead, it seems that I crushed the entrance of host name for the first box, I've identified using the steps above with the host name of the second box, that I've identified by following the steps above.

    I looked through the manual as well as fact a search online, nothing helps.  Which brings me to this forum.

    How should we do to get the pilot configured to use the GPIB-ENET/100 boxes?

    Thanks in advance.  Out of my ibconf is below (that's what it actually looks like, either incidentally - the strange on the line with dev2, dev13, and dev24 is not an artifact of copy/paste):

    ===============================================================================
    National Instruments GPIB Software Configuration utility Rev A.3.
    Copyright (c) 1991 National Instruments Corp.   All rights reserved.
    ===============================================================================

    File: / etc/gpibrc = CAPACITY: 8-plank 44 devices =
    ----------         -----------
    Press a key to continue * -.
    -----------------  -------
    ----------------  ----

    -------
    ----

    ===============================================================================
    National Instruments |    Card device for Council SPARCstation gpib0
    ===============================================================================
    -----------
    | GPIB0 |
    ----| nienetD |
    |   |_________|     * Use the cursor keys h, j, k, l & to select a device or a Commission.
    |                   * Use the buttons below to select the desired action.
    =====|------------------=======================================================
    | - 0 dev1 |-dev12 0 1 dev23 2 dev34
    = | - dev2 0 = = |-ev13 = 1 dev24 = 2 = dev35
    | - dev3 0 0 |---4 1 dev25 2 dev36
    | - dev4 0 1 dev15 1 dev26 2 dev37
    | - 0 dev5 1 dev16 1 dev27 2 dev38
    | - 0 dev6 1 dev17 1 dev28 2 dev39
    | - 0 dev7 1 dev18 2 dev29 2 dev40
    |---0 dev8            1 dev19           2 dev30                                                                   2 dev41
    | - 0 1 dev20 dev31 2 dev42 dev9 2 |-0 1 dev21 2 dev32 dev10
    | - 1 dev22 2 dev33 dev4311
    3 dev44
    |

    ^ Q: help ^ r: Rename ^ T: (de) connect ^ edit I: ^ o: output

    I just thought of it. My terminal has been updated with the ansi format. That was streaked the menu and blocks my view of the operating instructions ^ B / ^ F to see maps for more tips. The dockers affecting my vt100 terminal. You can even see how my menu was watered to the top at the bottom of my original message. I didn't know until now that the menu was supposed to look like different (although I knew it).

  • Help cascading two Linksys routers

    Hi, I tried to cascade two Linksys routers, but it did not work for me. Maybe you could help us. The first (which has the connection of the cable modem) is the brand new E4200, and the second is the former WRT54GCv3.

    That's how I want cascading them:

    ···································································
    Linksys E4200 ----(wireless)----(Desktop PC)·······················
    gw: 192.168.1.1 ·············|--(Laptop)···························
    ······|······················|--(iPad)·····························
    ······~······················|--(Home Server)······················
    ····(PLC)··························································
    ······~····························································
    ······|····························································
    Linksys WRT54GCv3 ·················································
    (Router mode|DHCP/NAT disabled) --(wireless)----(Playstation 3)····
    gw: 192.168.1.2 ·····························|--(Samsung BD-C8500)·
    ···································································
    

    However, the WRT54GCv3 does not receive the IP address of the DHCP E4200. I also tried to connect directly (without the PLC), even specifying a static IP address on the router second, but I got the same results.

    I have to State, that I will not change the gateway IP/first router because I have a web server and game works with a static IP address and I don't want to put it temporarily offline due to adjust the network settings.

    Thanks for your support!

    I searched the forum for you and found your answer.

    Go here for cascade two routers.

  • How to get emails from 2 tables of MySQL

    Hello

    I need to use only 1 query to get all emails that are stored in two different tables.

    Then, this is going to create a table and gets imploded for emailing, and another variable to display in a list on the page he exploded.

    Here's the query that receives emails from 1 table, but missing the instructions to get the emails in the other table (named: clients)

    <? PHP

    Receive emails from users.

    $user_sql = "SELECT * from users GROUP BY email;

    $user_query = $con-> query ($user_sql);

    $user_row = $user_query-> fetch_array();

    implode.

    $user_emails = array();

    While ($user_row = $user_query-> fetch_array())

    {

    [$user_emails] = $user_row ['email'];

    }

    Set the variables.

    $email_recipients = implode (",", $user_emails);

    $user_recipients = explode (', ', $email_recipients);

    ? >

    Thank you!

    $user_sql = 'SELECT FROM UNION SELECT prod_book email users';

Maybe you are looking for