Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
0 user currently in Programming. | 3 guests
Acmlm's Board - I2 Archive - Programming - PHP/mySQL question | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 158/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-04-04 01:54 AM Link | Quote
I'm wondering what is the php code that let's me display a link for every individual row in my table (lets say a User Table).

Something like this:
First Row of Table
Second Row of Table
Third Row of Table
Fourth Row of Table






(edited by DarkSlaya on 06-03-04 04:54 PM)
Parasyte

Bullet Bill
Level: 35

Posts: 41/514
EXP: 267348
For next: 12588

Since: 05-25-04

Since last post: 104 days
Last activity: 32 days
Posted on 06-04-04 02:21 AM Link | Quote
Something like this will do it.

$users=@mysql_query("SELECT id,name FROM users");
while ($user=@mysql_fetch_array($users)) echo "<a href=\"user.php?id=$user[id]\">$user[name]</a><br>\n";
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 159/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-04-04 03:17 AM Link | Quote
That was simple. I don't think the rest will be hard to add (connect to db). Thanks!
ErkDog

Fuzz Ball
Level: 47

Posts: 592/982
EXP: 752190
For next: 14013

Since: 03-15-04
From: Richmond, VA

Since last post: 40 days
Last activity: 19 days
Posted on 06-04-04 03:53 AM Link | Quote
the connection to the DB is done when you require function.php
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 160/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-04-04 05:15 AM Link | Quote
I still have one question:
How would I have a different link color depending on a attribute in my table (like the powerlevel/user sex, here)
Ghaleon
Newcomer
Level: 3

Posts: 2/2
EXP: 64
For next: 64

Since: 05-28-04

Since last post: 516 days
Last activity: 339 days
Posted on 06-04-04 06:29 PM Link | Quote
I'd suggest you learn php... because if you knew php this would be mad easy for you to do...
Modereb

Paragoomba
Level: 15

Posts: 1/75
EXP: 14749
For next: 1635

Since: 06-04-04

Since last post: 350 days
Last activity: 339 days
Posted on 06-04-04 10:02 PM Link | Quote
Even if you know a shitload of PHP, it's not like you'll emediately know how a new forum system is put together, especially if that system uses a bunch of custom functions, which is usually the case. Don't be a smartass.

Anyway, name colors are created using the sex and powerlevel fields, an example (assuming you are selecing the sex and powerlevel fields):

<font ".getnamecolor($user[sex],$user[powerlevel]).">$user[name]</font>

getnamecolor($user[sex],$user[powerlevel]) outputs strings like color=000000, color=453423, color=876543, etcetera.
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 161/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-05-04 12:55 AM Link | Quote
Originally posted by Ghaleon
I'd suggest you learn php... because if you knew php this would be mad easy for you to do...


I knew a little of PHP, but I skipped some things when I was learning.
Weasel
Missionary in Peru
Level: 34

Posts: 384/454
EXP: 236444
For next: 17207

Since: 03-15-04
From: Washington

Since last post: 467 days
Last activity: 339 days
Posted on 06-05-04 02:16 AM Link | Quote
Don't skip the basics Knowing how to do this kind of stuff is important for fun interactive sites.
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 162/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-05-04 04:37 AM Link | Quote
Yup. Now I have to do them all over again
*is annoyed by functions*


(edited by DarkSlaya on 06-04-04 08:21 PM)
Modereb

Paragoomba
Level: 15

Posts: 8/75
EXP: 14749
For next: 1635

Since: 06-04-04

Since last post: 350 days
Last activity: 339 days
Posted on 06-07-04 07:15 PM Link | Quote
Just learning PHP from a tutorial is futile.

Things like functions, custom functions, etcetera, it's all good and cool to know, but if you don't need them for a while, you won't use them and most likely will forget them anyway. Things you should get under your knee and know about, and not with just PHP for that matter, are syntax, possibilities and flexibility. Let's say you start building a webpage, and you're in need of a specific function, from that point, it's good to look up on the function, and if you did that a few times, or maybe even the first time, you'll get the hang of that function.

Don't just learn all kinds of stuff you most likely won't ever need anyway.
DarkSlaya
POOOOOOOOOOOORN!
Level: 88

Posts: 186/4249
EXP: 6409254
For next: 241410

Since: 05-16-04
From: Montreal, Quebec, Canada

Since last post: 8 hours
Last activity: 5 hours
Posted on 06-08-04 12:44 AM Link | Quote
I already knew that but thanks for remainding me.
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Programming - PHP/mySQL question | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.020 seconds.