Zymic Forums

Webmaster resources

Zymic IRC Server

Chat in real time at irc.zymic.com - Learn More

Welcome

Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.

In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.

left Zymic Webmaster ForumsWeb Design & DevelopmentServer Side ScriptingPHP right
left right
Louis W
post Feb 28 2008, 07:17 PM
Post #1


Newbie
*

Group: Members
Posts: 29
Joined: 24-February 08
Member No.: 11,483



Hello guys, just need a hand with a small php code integrated for ipb2.#

here is the simple code

CODE
<?php


//Database Info
$host = "#######";
$dbname = "#######";
$dbuser = "#######";
$dbpass = "########";
//Forum Url Must include 'index.php?showuser=' or link will not go to user profile
$url = "http://www.#########.com/forums/index.php?showuser=";
//Don't Edit Below
$con = mysql_connect($host,$dbuser,$dbpass);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
  mysql_select_db($dbname, $con);
  $result = mysql_query("SELECT * from ibf_members order by posts desc LIMIT 0, 10 ");
while($row = mysql_fetch_array($result))
  {
  echo "<a href=\"$url".$row['id']."\">".$style;
  echo $row['members_display_name'] . "</span></td><td>" . $row['posts'];
  echo "</a>";
  }
  mysql_close($con);
?>



Basically it works fine, however it show the forum names like this

name1name34

and i want it to show like this

name 1
name 34

i would highly apreciate the help
Go to the top of the page 
 
  + Quote Post
 
Start new topic
Replies (1 - 2)
Autistic Elephan...
post Feb 28 2008, 08:45 PM
Post #2


Member
**

Group: Members
Posts: 40
Joined: 17-January 08
From: Allendale, MI
Member No.: 7,246



You have some variables that I don't know exactly what they're doing (like style) because (I'm assuming) they're defined elsewhere... But I'm guessing it's something like "$style=<span bla bla bla>" because otherwise you've got an open span tag...


But anyway, you're doing </td><td> but I'm not even seeing the table? I'm not quite sure why you're doing that...
But if you were using a table, it'd be

<table>
while(bla bla)
{
echo "<tr><a href=\"$url".$row['id']."\">".$style;
echo "middle stuff bla bla bla"
echo "</tr></a>";
}
</table>

If you weren't using a table, just use a <br /> at the end of your echos inside the while...
echo "</a><br />";
}
Go to the top of the page 
 
  + Quote Post
Louis W
post Feb 28 2008, 08:53 PM
Post #3


Newbie
*

Group: Members
Posts: 29
Joined: 24-February 08
Member No.: 11,483



its just a script i found on invisionise i havnt made it, il give it a go now, thanks.

Worked. Thanks alot!
Go to the top of the page 
 
  + Quote Post
 Closed Topic Start new topic
left right
0 Members:
left right
 


Lo-Fi Version Time is now: 20th June 2013 - 04:58 AM