refiking Posted June 12, 2007 Share Posted June 12, 2007 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 />"; Quote Link to comment https://forums.phpfreaks.com/topic/55322-table-creation-question/ Share on other sites More sharing options...
pikemsu28 Posted June 12, 2007 Share Posted June 12, 2007 echo "<TR><TD>".$ipaddy."</TD><TD>".$login."</TD><TD>".$logout."</TD><TD>".$os."</TD><TD>".$ib."</TD></TR><br />"; or echo "<TR><TD>$ipaddy</TD><TD>$login</TD><TD>$logout</TD><TD>$os</TD><TD>$ib</TD></TR><br />"; Quote Link to comment https://forums.phpfreaks.com/topic/55322-table-creation-question/#findComment-273448 Share on other sites More sharing options...
refiking Posted June 12, 2007 Author Share Posted June 12, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/55322-table-creation-question/#findComment-273451 Share on other sites More sharing options...
chigley Posted June 12, 2007 Share Posted June 12, 2007 $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)){ Quote Link to comment https://forums.phpfreaks.com/topic/55322-table-creation-question/#findComment-273512 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.