/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Table Boaders not showing with no data

Table Boaders are not showing in IE7 with no data from the database they show in fire fox fine Ant help would be Great

[CODE]echo “<TABLE BORDER=2 align=center >”;
echo “<TR><TD><B>Username</B><TD><B>Password</B><TD><b>Name</b><td><b>Street</b><td><b>City</b><td><b>State</b><td><b>Zip</b><td><b>Phone </B><td><b>E-Mail</b><td><b>info</b><td><b>Admin</b><TH COLSPAN=3><b>Options</b></TH>
</TR>”;
while ($myrow = mysql_fetch_array($result))
{
echo “<TR><TD>”.$myrow[“username”].”<td>”.$myrow [“password”].”<td>”.$myrow[“name”].”<td>”.$myrow[“street”].”<td>”.$myrow[“city”].”<td>”.$myrow[“state”].”<td>”.$myrow[“zip”].”<td>”.$myrow[“phone”].”<td>”.$myrow[“email”].”<td>”.$myrow[“info”].”<td>”.$myrow[“admin”];
// “<TD><a href=”_view.php?id=”.$myrow[‘id’].””> <img src= “.$img_view.” ></a>”;
echo “<TD><a href=”_deleteparticipant.php?id=”.$myrow[‘id’].””> <img src= “.$img_delete.”> </a>”;
echo “<td><a href=”updateparticipant.php?id=”.$myrow[‘id’].””> <img src= “.$img_edit.”> </a>”;

}
echo “</TABLE>”;[/CODE]

to post a comment
HTML

11 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 11.2009 — Test for 'no data' and add a space character.
Copy linkTweet thisAlerts:
@r2ksauthorNov 11.2009 — How would i test for no Data and add space character ???
Copy linkTweet thisAlerts:
@necrojusticeNov 11.2009 — Add the section in bold to the areas that won't show a border.
[CODE]
echo "<td><a href="updateparticipant.php?id=".$myrow['id'].""> <img src= ".$img_edit."> </a>" [B].'&nbsp;'[/B];
[/CODE]


Something similar for that with each section of the table will force a border in IE even if no data is available.
Copy linkTweet thisAlerts:
@r2ksauthorNov 11.2009 — Tried that and all i got was a Couple of "" in the options box and nothing else
Copy linkTweet thisAlerts:
@necrojusticeNov 11.2009 — Try adding this to your CSS

table {

border-collapse: collapse;


}
Copy linkTweet thisAlerts:
@FangNov 11.2009 — while ($myrow = mysql_fetch_array($result))
{
foreach ($myrow as $key =&gt; $value) {
if ($value=='') {
$myrow[$key] = '&amp;nbsp;';
}
.
.

or put your document into strict mode
Copy linkTweet thisAlerts:
@r2ksauthorNov 11.2009 — Thank you for your Replay

I placed your Code in there and this is what i get

Parse error: syntax error, unexpected $end in /var/www/virtual/eventtracker/adminparticipants.php on line 115

There is no $end on line 115

foreach ($myrow as $key => $value)[COLOR="Red"] {[/COLOR]

if ($value=='') {

$myrow[$key] = '&nbsp;';

}

Found the Problem with your Code

after fixing that No data shows up at all
Copy linkTweet thisAlerts:
@FangNov 12.2009 — I tested the snippet of code and it works correctly. Show how you implemented it.
Copy linkTweet thisAlerts:
@r2ksauthorNov 12.2009 — Thank you for your Willingness to keep helpin me.

as i said all the fields are blank with the Code here is the way i have it..
[CODE]$result = mysql_query("SELECT * FROM users ",$con);
echo "<TABLE BORDER=2 align=center> ";
echo "<TR><TD><B>Username</B><TD><B>Password</B><TD><b>Name</b><td><b>Street</b><td><b>City</b><td><b>State</b><td><b>Zip</b><td><b>Phone </B><td><b>E-Mail</b><td><b>info</b><td><b>Admin</b><TH COLSPAN=3><b>Options</b></TH>
</TR>";
while ($myrow = mysql_fetch_array($result))
foreach ($myrow as $key => $value)
if ($value=='') {
$myrow[$key] = '&nbsp;';
}

{
echo "<TR><TD>".$myrow["username"]."<td>".$myrow ["password"]."<td>".$myrow["name"]."<td>".$myrow["street"]."<td>".$myrow["city"]."<td>".$myrow["state"]."<td>".$myrow["zip"]."<td>".$myrow["phone"]."<td>".$myrow["email"]."<td>".$myrow["info"]."<td>".$myrow["admin"];
"<TD><a href="_view.php?id=".$myrow['id'].""> <img src= ".$img_view." ></a>";
echo "<TD><a href="_deleteparticipant.php?id=".$myrow['id'].""> <img src= ".$img_delete."> </a>";
echo "<td><a href="updateparticipant.php?id=".$myrow['id'].""> <img src= ".$img_edit."> </a>";

}
echo "</TABLE>";
"<table width="23%" border="1" align="center">
<tr>
//<td><a href="_add.php">CREATE NEW RECORD</a></td>
</tr>
</table>";[/CODE]

Thank you
Copy linkTweet thisAlerts:
@FangNov 12.2009 — echo "&lt;TABLE BORDER=2 align=center &gt;";
echo "&lt;TR&gt;&lt;TD&gt;&lt;B&gt;Username&lt;/B&gt;&lt;TD&gt;&lt;B&gt;Password&lt;/B&gt;&lt;TD&gt;&lt;b&gt;Name&lt;/b&gt;&lt;td&gt;&lt;b&gt;Street&lt;/b&gt;&lt;td&gt;&lt;b&gt;City&lt;/b&gt;&lt;td&gt;&lt;b&gt;State&lt;/b&gt;&lt;td&gt;&lt;b&gt;Zip&lt;/b&gt;&lt;td&gt;&lt;b&gt;Phone &lt;/B&gt;&lt;td&gt;&lt;b&gt;E-Mail&lt;/b&gt;&lt;td&gt;&lt;b&gt;info&lt;/b&gt;&lt;td&gt;&lt;b&gt;Admin&lt;/b&gt;&lt;TH COLSPAN=3&gt;&lt;b&gt;Options&lt;/b&gt;&lt;/TH&gt;
&lt;/TR&gt;";
while ($myrow = mysql_fetch_array($result))
{
[COLOR="Navy"]foreach ($myrow as $key =&gt; $value) {
if ($value=='') {
$myrow[$key] = '&amp;nbsp;';
}
[/COLOR] echo "&lt;TR&gt;&lt;TD&gt;".$myrow["username"]."&lt;td&gt;".$myrow ["password"]."&lt;td&gt;".$myrow["name"]."&lt;td&gt;".$myrow["street"]."&lt;td&gt;".$myrow["city"]."&lt;td&gt;".$myrow["state"]."&lt;td&gt;".$myrow["zip"]."&lt;td&gt;".$myrow["phone"]."&lt;td&gt;".$myrow["email"]."&lt;td&gt;".$myrow["info"]."&lt;td&gt;".$myrow["admin"];
// "&lt;TD&gt;&lt;a href="_view.php?id=".$myrow['id'].""&gt; &lt;img src= ".$img_view." &gt;&lt;/a&gt;";
echo "&lt;TD&gt;&lt;a href="_deleteparticipant.php?id=".$myrow['id'].""&gt; &lt;img src= ".$img_delete."&gt; &lt;/a&gt;";
echo "&lt;td&gt;&lt;a href="updateparticipant.php?id=".$myrow['id'].""&gt; &lt;img src= ".$img_edit."&gt; &lt;/a&gt;";

<i> </i>}
<i> </i>echo "&lt;/TABLE&gt;";
Copy linkTweet thisAlerts:
@r2ksauthorNov 12.2009 — AWSOME it worked... Thank you listen this is what i did
[CODE]foreach ($myrow as $key => $value) {
if ($value=='') {
$myrow[$key] = '&nbsp;';
}
}[/CODE]

I had to add a second Closeing Bracket when i placed the code in like this
[CODE]foreach ($myrow as $key => $value) {
if ($value=='') {
$myrow[$key] = '&nbsp;';
}
[/CODE]

I would Get a Error

Parse error: syntax error, unexpected $end

in /var/www/virtual/pledges/adminparticipants.php on line 111

THANK YOU SO MUCH for your Help ? have a Blessed Day
×

Success!

Help @r2ks spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...