<?php
$sql = mysql_query("
SELECT navn FROM member_film WHERE username = '$pusername'
UNION SELECT meetup FROM member_meetups WHERE byusername = '$pusername'
UNION SELECT title FROM member_tutorials WHERE username = '$pusername'");
$rowit = mysql_fetch_array($sql);
$number = mysql_num_rows($sql);
?>
<? echo $number; ?>
<? echo $rowit["navn"]; ?><br>
<? echo $rowit["meetup"]; ?><br>
So i have this. Now, i have 3 columns where username is username in the database. 2 in member_film, 1 in member_meetups
The echo $number, shows it correct, that i have 3.
Now when i try to echo the "navn", it echo only 1, when there is 2 columns? And when i try to echo "meetup" it says undefined index: meetup, like there's nothing to show.. but there is, mysql_num_rows founded it, else it would have been 2?
I think most of you misunderstood me.. I want to show what the user($pusername) have been posted, in member_film, member_meetups, member_tutorials.. And then if e.g the user have 2 columns with his username, i want to display the "navn" from the same column. Same with title on member_tutorials, and meetup on member_meetups.
An example on how i want it to look like:
Your posts: (which as i want, checks the three table if there's any columns with the user's username in "username" column.)
My new video, its so good (navn, which is from member_film)
My boring meetup with my parents (title, which is from member_meetup)
My great great video!(navn, which is from member_film)