Query help please

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
rizzah00
Forum Newbie
Posts: 1
Joined: Fri Aug 08, 2003 2:39 pm

Query help please

Post by rizzah00 »

Hello, brief description of my mysql tables are

owners
-user_id
-email
-aim
-team_id

teams
-team_id
-location
-name
-pre

here's my query that i use

Code: Select all

<?php   

mysql_connect("localhost", "user", "pass");   
mysql_select_db("database");   
$query = "select t.team_id, o.team_id, o.email, t.name, o.aim, t.location, from owners o, teams t WHERE o.team_id = t.team_id";  
   
$result = mysql_query($query);   
while($row = mysql_fetch_array($result))&#123;   


      echo "&#123;$row&#1111;'location']&#125;";  
      echo "nbsp;";  
      echo "&#123;$row&#1111;'name']&#125;";  
      echo " ";  
      echo "&#123;$row&#1111;'email']&#125;";  
      echo " ";  
      echo "&#123;$row&#1111;'aim']&#125;";  
      echo "<br>";  

   
&#125;   
?>
and heres my error message
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/styckx/public_html/maddenworld/owners.php on line 25
any help in remedying the situation would be GREATLY appreciated
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

Post by kendall »

Yo man...

team AS t and owners AS o....but i think you will probably would have figured it out by now
Post Reply