I am having a Major Problem with displaying a table using the results from MYSQL database.
Here are the problems:
I want the Member Name's to be in caps. But I am unsure as to how to do this using the strtoupper() function inside or outside the loop- any suggestions as to how to do this?
The results, as you can see from the code below is fetched from 2 different tables within the database, but I need to display them within the same HTML table. I have tried everything I know of, including what is written below. I have always only had to display results from one query, not two. How can I accomplish this?
This is the strange part. The resulting table so far displays everyone in the database except for the first record! I am unsure as to what to do about this. Am I missing something here? I know the record is there.
<?php
##############################################
This Script will display the Member List
##############################################
include ("Variables in File outside of root");
#########################
Connect to Database
#########################
$TableName1 = "bio";
$Link1 = mysql_connect($Host, $User, $Password);
mysql_select_db($DBName, $Link1);
$Query1 = "SELECT* from $TableName1";
$Result1 = mysql_query($Query1, $Link1);
$TableName2 = "profile";
$Link2 = mysql_connect($Host, $User, $Password);
mysql_select_db($DBName, $Link2);
$Query2 = "SELECT* from $TableName2";
$Result2 = mysql_query($Query2, $Link2);
#####################################################
Place results from both Queries into a variable
#####################################################
$row1 = mysql_fetch_array($Result1);
$row2 = mysql_fetch_array($Result2);
strtoupper($row1[cname]);
strtoupper($row1[position]);
##################################
Set up the table for display
##################################
print("<head><title>MEMBER LIST</title><body><TABLE ALIGN='left' BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH='100%'>
<TR ALIGN='left' VALIGN='LEFT'>
<TD><b>MEMBER NAME</b></TD>
<TD><b>DATE JOINED</b></TD>
<TD><b>POSITION</b></TD>");
######################################
Get ready for the Display Loop!!
######################################
while ($row1 = mysql_fetch_array($Result1)) {
print("<TR VALIGN=LEFT>");
print("<TD VALIGN=LEFT>$row1[cname]</TD>");
print("<TD VALIGN=LEFT>$row1[position]</TD>");
}
mysql_close($Link1);
while ($row2 = mysql_fetch_array($Result2)) {
print("<TD VALIGN=LEFT>$row2[date_joined]</TD>");
}
mysql_close($Link2);
print("</table></body>");
?>