Skip to main content

Thread: PHP select field where one entry equals entry in another field in same table


hi folks

i'm making new website , using mysql database cms using on operating website.

know bad idea use elses data base can keep data way is.

problem on forums page need organise topics under parent topics.

i.e have parent topic "general" , sub topic "general chit chat" parent topic "admin" , sub topic "only admins can see this" etc etc.

problem have have no idea how cms managed order these same part of database.

parent fields have forum_parent = 0 , sub topic forum_parent = forum_id of forum_parent.

make sense? not.

need figure out is, how select field forum_parent = forum_id of different field?

i'm coding in php

in advance

i'm not sure if understand question correctly bit confusing.

but, how making loop compare sub forum's value every other entry in table , see entries equal.

this:

1. count rows in table match, make loop repeat row-times (if there 10 rows, loop loop 10 times).

2. compare values 1 query (because can't think of sql way this). example: 1 query (or value) set 10, compare results query value , see if there hit.

3. when found, save value somewhere (if need to) , break loop.

way on how it, don't know if correct in case, should work if implement correctly in code.

hope cleared things @ least bit. (if didn't, can post small section out of database easier find real solution).


Forum The Ubuntu Forum Community Ubuntu Specialised Support Development & Programming Programming Talk [SOLVED] PHP select field where one entry equals entry in another field in same table


Ubuntu

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support