Jump to content

Recommended Posts

I have a 2 part question i hope is an easy Fix, i know very little about any of this, I have a list of teams that shows up and is is showing in ONE long column, i want to do to things, Make it multiple columns & sort alphabetically

 

like this:

123

456

789

 

Here is the link to the test page right now

http://tspclan.com/SS/test.php

 

And the page code (top half of it anyways)


<?php require_once("global.php");
$id = htmlentities($_GET['id']);
$order = mysql_real_escape_string($_GET['order']);
if($order == "levela")
{
$order = "ORDER BY `defwin` ASC";
$l_pre = "<a href='?id=$id&order=leveld'>";
$l_suf = "</a>";
}
elseif($order == "leveld")
{
$order = "ORDER BY `defwin` DESC";
$l_pre = "<a href='?id=$id&order=levela'>";
$l_suf = "</a>";
}
else
{
$order = "ORDER BY `defwin` DESC";
$l_pre = "<a href='?id=$id&order=levela'>";
$l_suf = "</a>";
}
$team = mysql_query(
"SELECT *
FROM
`teams`
WHERE `id`='".$id."'");
$t = mysql_fetch_array($team);
$team_title = mysql_real_escape_string($t['title']);
$t_tag = $t['tag'];
$page1 = $t['page1'];
$user = mysql_query(
"SELECT *
FROM
`users`	
WHERE `team`='".$id."'
$order");
?>
<script src="http://tspclan.com/js/fbid.js" type="text/javascript"></script>
<script src="http://tspclan.com/js/pid.js" type="text/javascript"></script>
<script src="http://tspclan.com/js/sorttable.js" type="text/javascript"></script>

<title><?php echo $team_title; ?></title>
</head>
<link href="http://tspclan.com/mkportal/templates/TSP/style.css" rel="stylesheet" type="text/css" />
<body>
<div align="center">
<?php
if(mysql_num_rows($team) == false)
{
$team2 = mysql_query(
"SELECT *
FROM
`teams`");
?>
    <table width="100%" border="0" class="unsortable" cellspacing="0" cellpadding="0">
  <tr>
    <td background="img/hdr_left.jpg"> </td>
    <td width="590"><div align="center"><img src="img/hdr.jpg" width="590" height="346" /></div></td>
    <td background="img/hdr_right.jpg"> </td>
  </tr>
</table>
<br><br>
<table width="250"  cellspacing="0" class="unsortable" cellpadding="5" border="0" id="mwid">
<tr>
 <td align="center" valign="top" class="index_title unsortable" col span="3" >Team Name</td>
</tr>
    
<?php 
while($t2 = mysql_fetch_array($team2))
{
	$t_name = "<a  style='font-weight:bold; font color:#333333;' href='?id=".$t2['id']."'>".$t2['title']."</a>"; 

	echo "
        <tr> <td valign='top' align='center' width='50' class='row1 b_t' style='border-bottom:none; width:5px; background-color:#333333;'>".$t_name."</td>
	";
}
?>

 

2nd Part of my question, When i call for a team my link is test.php?id=(team id)

Is there a way to bring up multiple teams at the same time?

 

Link to comment
https://forums.phpfreaks.com/topic/221065-muliple-columns-help/
Share on other sites

sorry, fixed link

 

No problem :)

 

I have a list of teams that shows up and is is showing in ONE long column, i want to do to things, Make it multiple columns & sort alphabetically

 

To achieve multiple columns, keep a counter of the rows in your loop, then check to see if it hits a specific number and create a new column.  You need to add ORDER BY teams ASC to your query for alphabetic sorting.

 

When i call for a team my link is test.php?id=(team id)

Is there a way to bring up multiple teams at the same time?

 

Not sure exactly what you're trying to do here.

Ok here is what i am talking about

http://www.tspclan.com/SS/test.php?id=1

 

You will see a list of a team and its members from the database

 

Team id=1

 

Lets say i want to see team 1 & team 20 on one page is that possible?

 

Yes, it's possible.  Currently, that value is dictated by the individual team link.  You have have to create something to allow the user to choose multiple teams (Like a checkbox next to each team or something).

Im sorry i am a total noob at this, i dont know much about any of this at all, someone else wrote this little script and disappeared, i have no idea what im doing, nor understand this, out side of Making it look better.

 

We need to know how you want the user interface to look before giving you more advice. (checkboxes, manual type team names etc...)

ok i guess the first thing would be to sort the teams into set number of columns horizontally or vertically either way is fine with me preferably alphabetically,

 

(least important) the working link is as i showed you before ?id=1 is it possible to add ?id=1&id=30 or something similar?

For the part i am editing i will enter the code i have, i have searched for 3 days for this answer, just all of the examples i see are not like mine, so i dont know where to put anything

 

<?php require_once("global.php");
$id = htmlentities($_GET['id']);
$order = mysql_real_escape_string($_GET['order']);
$team = mysql_query(
"SELECT *
FROM
`teams`
WHERE `id`='".$id."'");
$t = mysql_fetch_array($team);
$team_title = mysql_real_escape_string($t['title']);
$t_tag = $t['tag'];
$user = mysql_query(
"SELECT * FROM `users`	WHERE `team`='".$id."' $order");


?>
<title><?php echo $team_title; ?></title>
</head>
<link href="http://tspclan.com/mkportal/templates/TSP/style.css" rel="stylesheet" type="text/css" />
<body>
<div align="center">
<?php

if(mysql_num_rows($team) == false)
{ $team2 = mysql_query( "SELECT * FROM `teams` ORDER BY `title` ASC ");
?>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td background="img/hdr_left.jpg"> </td>
    <td width="590"><div align="center"><img src="img/hdr.jpg" width="590" height="346" /></div></td>
    <td background="img/hdr_right.jpg"> </td>
  </tr>
</table>
<br><br>
<table width="300" cellspacing="0" cellpadding="5" border="0" >
    <tr>
 <td align="center" valign="top" class=" b_ll b_tt b_rr b_bb" colspan="2" style="font-weight:bold; color:#ffffff;">Team Listing</td>
</tr>
<tr>
 <td align="center" valign="top" class="index_title b_ll b_rr">Team Name</td><td align="center" valign="top" class="index_title b_rr" colspan="2">Tag</td>
</tr>
<?php

while($t2 = mysql_fetch_array($team2))
{
	$t_name = "<a  style='font-weight:bold;' href='SS.php?id=".$t2['id']."'>".$t2['title']."</a>"; 


	echo "<tr> <td  align='center' valign='top'  class='row1 b_t b_l b_ll' style='border-bottom:none; background-color:#333333;'>".$t_name."</td><td align='center' valign='top' class='row1 b_t b_l b_rr' style='font-weight:bold; color:#fff000; border-bottom:none; Background-color:#333333;'>".$t2['tag']."</td></tr>";
}
?><?php

}

?></table>
</div>
</body>
</html>

 

The working link is

 http://www.tspclan.com/SS/listing.php

I need a set amount of columns, not rows, because today i have over 200 teams listed, next week it could be over 400, My whole problem is this

I have seen hundreds of tutorials on different ways this could be handled,  when i try applying them to my code i get many errors & nothing, This is the

reason i came here for help. If you cannot help me please be honest & let me know. This simple task has taken me over 3 weeks, i am honestly frustrated over it

All anyone has done is point me to something else i completely dont understand.

This is the reason i came here for help. If you cannot help me please be honest & let me know. This simple task has taken me over 3 weeks, i am honestly frustrated over it

All anyone has done is point me to something else i completely dont understand.

 

To tell you the truth, this is a free help forum, not many people are going to write the code for you.  The point of a tutorial is to read & understand it so you can implement it yourself.  If you have trouble, post the code and we'll help you with specific problems.

Ok thanks for that i guess that means i will go elsewhere, thanks

 

I will really try to be as polite as possible, but your attitude is just plain wrong! People spend endless amounts of time on this forum helping people PROBLEM SOLVE and sometimes, yeh, people go above and beyond and actually produce a significant amount of code for someone.

 

Why the hell should somebody write code for you for free which you are getting paid for?

 

If you can't be bothered learning, and you don't have money - you're stuck. You aint going nowhere. You can't do the work yourself and you can't hire it out.

 

There is no problem here to solve. You want somebody to come along and write all of the code and you don't seem to even care how it works, just that it does work. This is how a 'client' thinks - yet you're a developer, not a client. You don't have that privilege!

Ok and now you have to reply in a insulting manner? I see exactly clear how respectable you are here. 

And i will pass this info along....

 

First of all, no single member represents the entire community. Personally, I have a big issue with people with an entitlement attitude. If I read your post wrong, I'm sorry. We are, afterall, communicating over a forum.

 

Again, I do not speak for the forum or it's members and neither do any of the mods. The community is made up of individuals with their own values.

 

Couple of weeks ago I wrote a script for someone on here for free! Took me a couple of hours. Believe me, I enjoy nothing more than helping people. But your last post seemed like you didn't really care at all about learning - "i guess that means i will go elsewhere" was your answer to somebody saying you need to produce your own code and get help with the specifics.

 

It's called an entitlement attitude and I suggest you keep it in check on help forums.

Anti- moronic kiss my a$$  when i asked for help None of you "Genius's " jumped in to assist, I never expected anyone to write hours of code, Ive seen the examples, its 4 or 5 lines tops i have tried adding them to my code it just doesnt work because i dont understand any of this and i dont get paid for this, this is a script that i use personally. I guess i came to the wrong place. And from the last 2 replies I Definately know i did.

Anti- moronic kiss my a$$  when i asked for help None of you "Genius's " jumped in to assist, I never expected anyone to write hours of code, Ive seen the examples, its 4 or 5 lines tops i have tried adding them to my code it just doesnt work because i dont understand any of this and i dont get paid for this, this is a script that i use personally. I guess i came to the wrong place. And from the last 2 replies I Definately know i did.

 

The code you provided didn't show a hint of you trying to implement what you were trying to do.  If you provide the failing code with the example(s) you've tried then we can better assist you.

Anti- moronic kiss my a$$  when i asked for help None of you "Genius's " jumped in to assist, I never expected anyone to write hours of code, Ive seen the examples, its 4 or 5 lines tops i have tried adding them to my code it just doesnt work because i dont understand any of this and i dont get paid for this, this is a script that i use personally. I guess i came to the wrong place. And from the last 2 replies I Definately know i did.

 

From the last 2 replies? Will you stop it with this minority represent the majority stuff?

 

Maybe you should create a new thread because of the reply count people will think you're being helped. If you don't think you are, restructure your question and create a new thread based on a specific problem with all the info you can get.

 

Check my other replies. I spend a lot of time trying to help people. I came in this thread to help, and was shocked at your post:

 

"This is the reason i came here for help. If you cannot help me please be honest & let me know. This simple task has taken me over 3 weeks, i am honestly frustrated over it

All anyone has done is point me to something else i completely dont understand."

 

What do you want? If you don't understand, nobody can help you. What's the point in giving you code - you don't understand it lol If you can't see how you were in the wrong (you're on a help forum bare in mind), then I dunno..

Yeh, and please try to understand that the people on this forum are SELFLESS! get that in your head!! Nobody here gets paid for ANYTHING, and least of all basic members like myself.

 

I don't expect or demand appreciation, but I DO demand a willingness to learn from the people I'm trying to help.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.