Hi All,
I’m running a query and after that query I want to run a thank you message:
[code=php]
$result = mysql_query(“Insert into results(team_one_id ,team_two_id) values(‘$team_one_id”$team_two_id’)”);
$msg = “Thank you the fixture ” . $team_one_id .” v’s ” . $team_two_id .” has been added to the database. Please continue or <a href=’../index.php’>Return to the index </a>”;
Now the data I enter in the database I want to be able to say find the values entered in the database ie: [b]1 v’s 2
And then lookup the values in the database in another table [b]teams
So the thank you message would output as:
[b]team a v’s team b
[b]teams
Team_id | Name
1 | Team A
2 | Team B
Now this is the code I have for doing this:
[code]
SELECT th.team_name AS home_team, ta.team_name As away_team, r.home_score, r.away_score, r.results_id
FROM results r
INNER JOIN teams th ON r.team_one_id = th.team_id
INNER JOIN teams ta ON r.team_two_id = ta.team_id
So how can I run my insert query whilst running the above at the same time to produce my thank you message?