combine multiple row that have same id

Codes here !

Moderators: macek, egami, gesf

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Thu Feb 27, 2003 11:33 pm

I am curious on what you are trying to accomplish with this data. There may be a way if I know the end results.

Romantik
New php-forum User
New php-forum User
Posts: 67
Joined: Mon Feb 24, 2003 2:55 am
Location: ../Ukraine/Kherson
Contact:

Postby Romantik » Fri Feb 28, 2003 2:16 am

I think, you have wrong structure of base

table name
id name
1 Matt
2 Sarah
3 Tom

table surname
id ind name
1 1 John
2 2 Gina

where name.id=surname.ind

SELECT name.name AS name, surname.name AS surname
FROM name INNER JOIN surname ON name.id=surname.ind
ORDER BY name.id

while($row=......
{
$name= $row["name"];
$surname= $row["surname"];
echo $name." ".$surname."<BR>";
}


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 1 guest