Jump to content

[SOLVED] PhP code SQL results ..


FedEx11

Recommended Posts

I have this

<body background = "bg.jpg">
<?php
$con = mysql_connect("localhost","root","");
//or die(mysql_error());


mysql_select_db('tennis',$con);
//or die(mysql_error());

$result = mysql_query("SELECT p1.player_name as 'Player1',
p2.player_name as 'Player2',
m.Result as 'Result',
m.Score as 'Score',
m.Location as 'Location',
m.Date as 'Date'

from matches m , players p1, players p2
WHERE 
p1.ID = m.Player1_ID
and p2.ID = m.Player2_ID
order by m.Date desc ");

if (!$result) {
die(mysql_error());
}

while ($row = mysql_fetch_assoc($result)) {
print_r($row);

}
mysql_close($con); 

 

The problems is the result is showing like this :

 

Array ( [Player1] => John Doe [Player2] => Jason Doe [Result] => D [score] => 6/4 5/7 [Location] => PAris [Date] => 2009-09-17 ) Array ( [Player1] => John Doe [Player2] => Micheal Doe [Result] => W [score] => 6/2 6/1 [Location] => London [Date] => 2009-09-15 )

 

 

Any idea what im doing wrong ?

 

Link to comment
https://forums.phpfreaks.com/topic/175556-solved-php-code-sql-results/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.