Jump to content

Table Creation Question


refiking

Recommended Posts

Hey all.  I am trying to create a table and I just got this error:

 

Parse error: parse error, unexpected T_VARIABLE, expecting ',' or ';' in /home/ctpwebco/public_html/leads/comproc.php on line 29

 

Here's line 29:

 

echo "<TR><TD> "$ipaddy" </TD><TD>"$login"</TD><TD>"$logout"</TD><TD>"$os"</TD><TD>"$ib"</TD></TR><br />";

Link to comment
https://forums.phpfreaks.com/topic/55322-table-creation-question/
Share on other sites

Great!  That took away the error, but it is still not showing the data from the table.  Here is what I have.  Can you tell me what I am missing?

 

	mysql_connect("a", "b", "c") or die(mysql_error());
mysql_select_db("db") or die(mysql_error());
   $que = mysql_query("SELECT `analyst_id` FROM `Analysts` WHERE username = '$username'");
   while($row1 = mysql_fetch_assoc($que)){
   $analyst_id = $row1['analyst_id'];
   }
   echo $analyst_id;
   
$sql = mysql_query("SELECT ipaddy, login, logout, os, ib FROM Sessions WHERE analyst_id = '$analyst_id'");
while($row = mysql_fetch_assoc($que)){
   $ipaddy = $row['ipaddy'];
   $login = $row['login'];
   $logout = $row['logout'];
   $os = $row['os'];
   $ib = $row['ib'];
   }


	echo "<TABLE BORDER=1><TR><TH>IP Address</TH><TH>Login Time</TH><TH>Logout Time</TH><TH>Operating System</TH><TH>Internet Browser</TH><TH> </TH></TR>";


	echo "<TR><TD>$ipaddy</TD><TD>$login</TD><TD>$logout</TD><TD>$os</TD><TD>$ib</TD></TR><br />";



	echo "</TABLE>";

?>

 

Now, when I echoed $analyst_id, It's shows up fine.  I've already triple checked the table names to make sure they were identical.

 $sql = mysql_query("SELECT ipaddy, login, logout, os, ib FROM Sessions WHERE analyst_id = '$analyst_id'");
while($row = mysql_fetch_assoc($que)){

// to:

$sql = mysql_query("SELECT ipaddy, login, logout, os, ib FROM Sessions WHERE analyst_id = '$analyst_id'");
while($row = mysql_fetch_assoc($sql)){

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.