Jump to content

rizzah00

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

rizzah00's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hello, i\'m quering the database here is my code <?php mysql_connect("localhost", "user", "pass"); mysql_select_db("database"); $query = "select r.id, r.week, r.awayteam, r.hometeam, t.team_id FROM results r, teams t"; $result = mysql_query($query); $numrows = mysql_num_rows($result); while($row = mysql_fetch_array($result)){ echo "<tr>"; echo "<td>"; echo "{$row[\'id\']}"; echo "-"; echo "</td>"; echo "<td>"; echo "week"; echo "{$row[\'week\']}"; echo "</td>"; echo "<td>"; echo "{$row[\'awayteam\']}"; echo "</td>"; echo "<td>"; echo "{$row[\'hometeam\']}"; echo "</td>"; } ?> I get the query results and right now there are only two entries into that table, yet whenever i query the database i get like 30 some results but its just the two that are in the database alternating any help would be appreciated...
  2. okay i finally got everything set to where i want it i tweaked some code to try to get another cell from the query and i get this error Here\'s my code <?php mysql_connect("localhost", "user", "pass"); mysql_select_db("database"); $query = "select 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)){ echo "{$row[\'location\']}"; echo "nbsp;"; echo "{$row[\'name\']}"; echo " "; echo "{$row[\'email\']}"; echo " "; echo "{$row[\'aim\']}"; echo "<br>"; } ?> any help would be appreciated
  3. much thanks, ive left mysql for a year now, trying to get everything to come back
  4. I have two tables in my database -owners -teams in my owners table i have fields for email user_id name and team_id in my teams table i have fields for team_name and team_id I want to do a query that will replace the owners team_id with the teams team_name, i have linked everything correctly, what would the query be? how would i go about displaying this on a page with php?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.