Re: Join tables

From: Date: Thu, 28 Feb 2002 09:40:35 +0000
Subject: Re: Join tables
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-17357@lists.php.net to get a copy of this message
the best tool for building "join" queries is MS Access . make a db same as that you use in mysql and build the query with access. then copy/paste queries from there. to build queries in access is very simple . drag/drop and other visual ways. Jennifer Downey a écrit : > Hi all, > > Ok first I have figured out my question on storing an image path. > > my question now is on joining data from two tables. > > wt_users has two fields (cols) called > uid and pid, > uid refers to the user > pid refers to the users pet > > image_data has a field called > id which refers to the image path > > id in image_data has the same value as id in wt_users > 1 1 > > These two queries are what are needed to get the image to display: > $pet = mysql_query("select id from wt_users where uid={$session["uid"]}"); > $ret = mysql_query($pet); > > $query = "select binary_data,filetype from image_data where id=$id"; > $result = @mysql_query($query); > > I'm using echo "<img src=\"petdata.php?id= this should correspond with > both id's \">"; to display the image > > how do I join the two tables so that the id's match and give the correct image? > > And again thanks in advance for your help > Regards > Jennifer Downey > > P.S. I have looked at the mysql manual and a few tutorials. None of them helped or worked. -- Marius Ursache (3563 || 3494) \|/ ____ \|/ "@'/ ,. \`@" /_| \__/ |_\ \__U_/

« previous php.db (#17357) next »