Results 1 to 3 of 3

Thread: Join Issue

  1. #1
    Join Date
    May 2004
    Posts
    86

    Unanswered: Join Issue

    have a login procedure. i have a database called test where my login information is stored. i ahve a database called info where my information is stored. in both tables their is a key called userid. When a person logs in with their own username i want to show them their only information.

    you guys gave me this example and it returs this error
    Parse error: parse error, unexpected T_STRING in /home/ehpadmin/http/docroot/secretdb.php on line 84


    <?
    $searchtype =$HTTP_POST_VARS['name'];
    $conn = mysql_connect("lt","e","9t");
    mysql_select_db("eh",$conn);
    SELECT * FROM mem
    LEFT JOIN test on test.EHPID = mem.EHPID
    where test.name='someusername'
    $result=mysql_query($sql,$conn) or die(mysql_error());
    while ($row = mysql_fetch_assoc($result)){
    $firstname=$row['First'];
    $lastname=$row['Last'];
    echo '<font size=\"2\">Welcome,<font color="Black"><b><font size=\"2\">&nbsp;'.($firstname).'&nbsp;'.($lastnam e).'</font></b } ?>

    Much Help Needed thanks

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    those aren't databases, those are tables, a database is something else

    you say they're called test and info but your query uses mem and test

    the join looks okay to me

    if you have php issues, perhaps this question should be in the php forum?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Dec 2004
    Location
    Europe
    Posts
    20
    Putting an
    $sql = " ............................ "; around your select may help here

    (This is no "embedded sql" with precompiler like oracle or DB2 )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •