PDA

View Full Version : Problem Displaying Recordset


Maertz
04-11-2006, 02:17 PM
I am using dreamweaver mx 2004 and i am having some trouble getting it to display my recordset in a tabe. i have a session variable set up to pull up user info, but i cant get it to show up in a table for the user. So i have session variable for logged in user then i am trying to get there info (stats and so) to show up in a table for the user to see. the recordset works fine but i cant get it to show up in the table. all help is greatly appreciated.

degsy
04-11-2006, 02:32 PM
I'm guessing that you are doing something wrong.

Next guess?


Try posting some of your code where you think the problem lies.

Maertz
04-11-2006, 02:50 PM
lol ok i have to check when i get home. But i also agree something is not right.....

Maertz
04-13-2006, 02:19 PM
ok heres the code i have and i dont see anything wrong.

<p align="center">Welcome To The Main Page Of Torn Destiny. Here You Can see Updates, And Maybe See Some Useful Hints. Also Notice At The Top Of The Page You Can Navigate Almost Anywhere.</p>
<p align="center">&nbsp;</p>
<p align="center"><?php echo $_SESSION['MM_Username']; ?></p>


<table border="1" cellpadding="1" cellspacing="1">
<tr>
<td>userinfo_ID</td>
<td>health</td>
<td>money</td>
<td>strength</td>
<td>defense</td>
<td>accuracy</td>
<td>speed</td>
<td>magic</td>
<td>exp</td>
<td>register_ID</td>
<td>username</td>
<td>charname</td>
<td>password</td>
<td>email</td>
<td>chartype</td>
<td>usertype</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } while ($row_user = mysql_fetch_assoc($user)); ?>
</table>
</body>
</html>
<?php

Brandoe85
04-13-2006, 02:23 PM
Wheres your query? and wheres $user defined? Also, you can use a normal while loop instead of a do while. Makes it a bit cleaner to read.

degsy
04-13-2006, 02:28 PM
What does DW show when you test the recordset via the recordset dialogue box?

Maertz
04-13-2006, 02:32 PM
i will go check what else i have for code thats not with the able that may be where i have the query and stuff, but i may be missing that. also dreamweaver shows the table but no data when previewing it, but when i made the recordset o test it it showed the table with the info.

Maertz
04-13-2006, 02:39 PM
this is the only other code i have on this page, and it all goes above the last stuff i posted.

<?php require_once('Connections/gryphon.php'); ?>
<?php
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "Login Failed.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
$colname_user = "1";
if (isset($_SESSION['username'])) {
$colname_user = (get_magic_quotes_gpc()) ? $_SESSION['username'] : addslashes($_SESSION['username']);
}
mysql_select_db($database_gryphon, $gryphon);
$query_user = sprintf("SELECT * FROM userinfo WHERE username = '%s'", $colname_user);
$user = mysql_query($query_user, $gryphon) or die(mysql_error());
$row_user = mysql_fetch_assoc($user);
$totalRows_user = mysql_num_rows($user);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>welcome</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
a:link {
color: #FFFF00;
}
a:visited {
color: #FFFF00;
}
-->
</style></head>

<body>
<p align="center"><img src="Header.gif" width="576" height="123" border="6"></p>
<div align="center">
<table width="775" border="1">
<tr>
<td width="110"><div align="center"><a href="Home.php">Home</a></div></td>
<td width="125"><div align="center"><a href="Potion.php">Potion</a></div></td>
<td width="125"><div align="center"><a href="Armory.php">Armory</a></div></td>
<td width="125"><div align="center"><a href="welcome.php">Welcome</a> </div></td>
<td width="125"><div align="center"><a href="Battle.php">Battle</a></div></td>
<td width="125"><div align="center"><a href="City.php">City</a></div></td>
</tr>
</table>
<p>&nbsp;</p>
</div>

degsy
04-13-2006, 02:40 PM
Then what is the value of MM_Username?
echo it out to make sure you are getting a correct value that the query can accept.

degsy
04-13-2006, 02:41 PM
Your code is mixing $_SESSION['username'] and $_SESSION['MM_Username']

Maertz
04-13-2006, 02:41 PM
the value is of whoever is logged in at the time. and when i was logged in it was burt (test name) and it showed Burt where MM_Username was but the table was not showing any info. i open the home page and log in and it goes to this welcome page and shows im logged in as burt , but nothing in the table.

Maertz
04-13-2006, 02:44 PM
so do i have to remove one of them?and all of them or what? sorry to be such a noob.

Maertz
04-17-2006, 01:53 PM
bump if they are getting confused what do i do? should i gothrough and take out all of one because that dont seem like it would work. any more info?

Maertz
04-18-2006, 01:48 PM
bump

anyone got some info on this?

Brandoe85
04-18-2006, 02:04 PM
echo out $query_user and $totalRows_user. That should show you the query and how many rows it returned.

Maertz
04-18-2006, 02:21 PM
i use dreamweaver and never had to make up an echo code on my own, could you help me out with it?

Brandoe85
04-18-2006, 02:29 PM
OK,
Just put this in:

echo $query_user . "<br>" . 'Rows returned: ' . $totalRows_user;

Maertz
04-18-2006, 02:35 PM
ok thanks man i appreciate the help one last nob question, do i just put it in at the bottom of all my other code?

Brandoe85
04-18-2006, 02:44 PM
Yeah just put it in under rest.

degsy
04-18-2006, 03:58 PM
Replace all references of $_SESSION['username'] with $_SESSION['MM_Username'])

Maertz
04-19-2006, 02:16 PM
ok just did both of them and now i get this error when trying to preview the website. Parse Error: parse error in /Library/Webserver/Documents/Torn Destiny/ Welcome.php on line 37, which is this line in the second group of code i posted on the first page.


if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";

degsy
04-19-2006, 03:06 PM
Replace all references of $_SESSION['username'] with $_SESSION['MM_Username'])
If you copied that directly then remove the ). It shouldn't be there.

Maertz
04-20-2006, 02:11 PM
i just took out the ) and now i get the same error but on line 27 line 27 is

$isValid = true;

Maertz
04-21-2006, 01:49 PM
bump.

Maertz
04-24-2006, 01:56 PM
anyone?

Maertz
04-25-2006, 01:53 PM
im guessing it has to do with the parentheses i added but im not sure is there any exception to where i should add the parentheses?

Maertz
04-26-2006, 01:50 PM
not one person knows?

MRMAN
04-26-2006, 02:10 PM
Hello,
Would you be able to post a upto date version of your code.
cheers

Maertz
04-26-2006, 02:46 PM
yeah give me a sec.

Maertz
04-27-2006, 01:57 PM
here ya go

<?php require_once('Connections/gryphon.php'); ?>
<?php
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "Login Failed.php";
if (!((isset($_SESSION['MM_Username']) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup']) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
$colname_user = "1";
if (isset($_SESSION['MM_Username'] {
$colname_user = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes$_SESSION['MM_Username'];
}
mysql_select_db($database_gryphon, $gryphon);
$query_user = sprintf("SELECT * FROM userinfo WHERE username = '%s'", $colname_user);
$user = mysql_query($query_user, $gryphon) or die(mysql_error());
$row_user = mysql_fetch_assoc($user);
$totalRows_user = mysql_num_rows($user);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>welcome</title>
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #000000;
}
a:link {
color: #FFFF00;
}
a:visited {
color: #FFFF00;
}
-->
</style></head>

<body>
<p align="center"><img src="Header.gif" width="576" height="123" border="6"></p>
<div align="center">
<table width="775" border="1">
<tr>
<td width="110"><div align="center"><a href="Home.php">Home</a></div></td>
<td width="125"><div align="center"><a href="Potion.php">Potion</a></div></td>
<td width="125"><div align="center"><a href="Armory.php">Armory</a></div></td>
<td width="125"><div align="center"><a href="welcome.php">Welcome</a> </div></td>
<td width="125"><div align="center"><a href="Battle.php">Battle</a></div></td>
<td width="125"><div align="center"><a href="City.php">City</a></div></td>
</tr>
</table>
<p>&nbsp;</p>
</div>
<p align="center">Welcome To The Main Page Of Torn Destiny. Here You Can see Updates, And Maybe See Some Useful Hints. Also Notice At The Top Of The Page You Can Navigate Almost Anywhere.</p>
<p align="center">&nbsp;</p>
<p align="center"><?php echo $_SESSION['MM_Username']; ?></p>


<table border="1" cellpadding="1" cellspacing="1">
<tr>
<td>userinfo_ID</td>
<td>health</td>
<td>money</td>
<td>strength</td>
<td>defense</td>
<td>accuracy</td>
<td>speed</td>
<td>magic</td>
<td>exp</td>
<td>register_ID</td>
<td>username</td>
<td>charname</td>
<td>password</td>
<td>email</td>
<td>chartype</td>
<td>usertype</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } while ($row_user = mysql_fetch_assoc($user)); ?>
</table>
</body>
</html>
<?php
mysql_free_result($user);
?>

MRMAN
04-27-2006, 02:19 PM
i notice this

if (($strUsers == "") && true)
{
$isValid = true;
}


think the problem might lie with the "&& true"

Maertz
04-27-2006, 02:39 PM
so should i just take that out?

MRMAN
04-27-2006, 04:50 PM
well you could take it out and see what happens.

Maertz
04-28-2006, 03:28 PM
now the error is on line 3 should i restart this whole page?

Maertz
05-01-2006, 01:57 PM
bump. are parse errors somewhat common? or if you get them should you basically start over.

Maertz
05-02-2006, 02:16 PM
juts redid the whole page and i get ta same problem i had originally. i cant see the recordset when i preview in browser the page but if i test the recordset in dreamweaver i can. so know one knows how to solve that problem without getting a parse error?

MRMAN
05-02-2006, 02:39 PM
Hello, sorry for the delay. been a busy few days.
anyhow there are two things i would like you to try.
firstly after the mysql query ($user = mysql_query($query....... etc)
put this

$test = mysql_num_rows($user);
print "---" . $test . "----";
die();


if you get ---12---- printed to your screen then you know there are 12 records and the query is working. if you are just getting -------- then the query isn't working.

if the query is working then try useing this instead of the current do while loop

<?php for($row_user = mysql_fetch_array($user) { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } ?>

degsy
05-02-2006, 02:56 PM
juts redid the whole page and i get ta same problem i had originally. i cant see the recordset when i preview in browser the page but if i test the recordset in dreamweaver i can. so know one knows how to solve that problem without getting a parse error?

Do you have a login page to set $_SESSION['MM_Username'] ?

Maertz
05-03-2006, 02:06 PM
on my login page i have the recordset for userinfo, that sorts by username which is equal to the session variable. will that work or is there a different way.

degsy
05-03-2006, 02:23 PM
I've just tried a login page and details page created with the inbuilt Dreamweaver scripts and it works fine.

I've noticed that the Repeat Region code you are using is not part of the Dreamweaver scripts. That shouldn't matter, but you should be using a While or Do While loop.


<?php do { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } while($row_user = mysql_fetch_array($user)); ?>



If that corrects the problem then you should look in to your PHP.INI error reporting settings as you should set it to output errors and not just a blank page.

Maertz
05-04-2006, 01:55 PM
so add that code to the bottom of my login page code? and thats weird that i had code that wasnt from dreamweaver because thats all i use unless they fixe it in a lter release.

degsy
05-04-2006, 02:19 PM
You said that your page is not getting any errors, it's just blank.
You also said that the query with the session var works in the dreamweaver recordset test window.

So the only thing left is that your code to output the recordset is wrong.

Maertz
05-04-2006, 02:27 PM
the whole page isnt blank just the table data is empty, and yes it worked in when testing the recordset but not in the preview browser, so still add that code at the bottm of the login or both? sorry im still a little lost.

degsy
05-04-2006, 02:46 PM
You put that code in the page where you want to see it.

Maertz
05-05-2006, 02:20 PM
@ degsy i had that code in there towards the bottom but i replaced it anyway and its still the same problem.

@MRMAN i also tried your code and when i put in the <?php for it gave me a parse error saying it was expecting a do.

MRMAN
05-05-2006, 02:25 PM
crap sorry i missed a ) off the then is should be this

<?php for($row_user = mysql_fetch_array($user)) { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } ?>


i really should read everything before i press the button


you could also put this at th etop of th epage. this will show all the errors and faults.
<? error_reporting(E_ALL); ?>
this needs to go in the php section

Maertz
05-05-2006, 02:48 PM
i put in the big line of code and got and got another parse error saying it was expecting a ';'' in welcome.php in line 95. line 95 is <p align = "center"></p>
and i put in the error reporting at the top and i got a parser error in line 114. line 114 is <td> chartype </td>

MRMAN
05-05-2006, 02:54 PM
ok usually error appear on the line above.
could you post a uptodate version of your script. or the section of code (say 10 lines above and 10 lines below) the problems.
Cheers

degsy
05-05-2006, 03:26 PM
I'm not sure how you are getting that to work. Have you tested it?


<?php for($row_user = mysql_fetch_array($user)) { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } ?>



Replace that code with this


<?php do { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } while ($row_user = mysql_fetch_array($user)); ?>

MRMAN
05-05-2006, 03:28 PM
crapola. really really sorry. being down loads of stuff and forgot to change something in the code.

<?php while($row_user = mysql_fetch_array($user)) { ?>
<tr>
<td><?php echo $row_user['userinfo_ID']; ?></td>
<td><?php echo $row_user['health']; ?></td>
<td><?php echo $row_user['money']; ?></td>
<td><?php echo $row_user['strength']; ?></td>
<td><?php echo $row_user['defense']; ?></td>
<td><?php echo $row_user['accuracy']; ?></td>
<td><?php echo $row_user['speed']; ?></td>
<td><?php echo $row_user['magic']; ?></td>
<td><?php echo $row_user['exp']; ?></td>
<td><?php echo $row_user['register_ID']; ?></td>
<td><?php echo $row_user['username']; ?></td>
<td><?php echo $row_user['charname']; ?></td>
<td><?php echo $row_user['password']; ?></td>
<td><?php echo $row_user['email']; ?></td>
<td><?php echo $row_user['chartype']; ?></td>
<td><?php echo $row_user['usertype']; ?></td>
</tr>
<?php } ?>

not it meant to be a while not a for.
sorry

Maertz
05-09-2006, 02:23 PM
@ degsy i just used your code and i dont get an error but i still get a blank table so its just like before.

@ mrman your code gave me another parse error.