Webmaster Forum

Lionsanime Directory   High Bandwidth Dedicated Servers   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 03-01-2007, 11:31 AM   #1 (permalink)
Inactive
 
Join Date: 01-02-04
Location: cheltenham
Posts: 7
iTrader: 0 / 0%
Latest Blog:
None

mullet is liked by many
Red face hello mysl php help

hia all

i have created a rat profile system using phpbb as the user system.

i have all parts in place but i have a lot of empty html tables.

what i need to do is if the result ( i.e. $vars[column]) doesn't exists then it doesn't show the area on the page that it would be displayed.

can any-one help? i have done this before on an old site but i have forgotten.

an example would be cool.
thanks, Mullet
mullet is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 03-02-2007, 05:42 PM   #2 (permalink)
Inactive
 
StupidScript's Avatar
 
Join Date: 09-22-06
Location: Los Angeles
Posts: 678
iTrader: 0 / 0%
Latest Blog:
None

StupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really niceStupidScript is just really nice
Here're a couple of examples ... don't quite know how deep the issue is:

1) Basic example that will use a space character when the value is empty:
Code:
..do query..id,name,address.. while($row=mysql_fetch_array($result)) { extract($row); if (!$name) { $name=" "; } if (!$address) { $address=" "; } }
2) Basic example to eliminate column from one-row result:
Code:
..do query..id,name,address.. while($row=mysql_fetch_array($result)) { extract($row); if (!$name) { $namecol=""; $nameval=""; } else { $namecol="<th>Name</th>"; $nameval="<td>".$name."</td>"; } if (!$address) { $addresscol=""; $addressval=""; } else { $addresscol="<th>Address</th>"; $addressval="<td>".$address."</td>"; } print "<table>\n"; print "<tr><th>ID</th>".$namecol.$addresscol."\n"; print "<tr><td>".$id."</td>".$nameval.$addressval."\n"; print "</table>\n"; }
There're lots of ways to do this ... it depends on what you want. You could use foreach($row as $key => $val) and test for empty $vals ... stuff like that.
StupidScript is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-02-2007, 07:39 PM   #3 (permalink)
Inactive
 
Join Date: 01-02-04
Location: cheltenham
Posts: 7
iTrader: 0 / 0%
Latest Blog:
None

mullet is liked by many
thank you,

thats exactly what i need
mullet is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 05:36 AM.
© Copyright 2008 V7 Inc