PDA

View Full Version : Link to another table


Not Logged In
11-27-2003, 09:02 PM
I've been able to add a new field to 'sites', however I'm having problems linking to another table.

I added a field called account_id and when I enter a site for indexing I enter the ID of the account I already have.

What I want to do is pass more information to each result from my client DB. ex. sites.account_id = clients.id.

I've tried adding it to ' $query = "SELECT sites.site_url, sites.port, ' but to no avail.

I've also added my table to the config.php.

Any help would be great!

Thanks!

Charter
11-28-2003, 04:54 AM
Hi. The sites.account_id = clients.id portion would go in the WHERE portion of the query, and you'd need to add the table clients into the FROM portion of the query.

The query you are editing uses results from the previous query so you may want to edit that previous query instead and then just select sites.account_id in the query you are currently editing.

Not Logged In
11-28-2003, 09:35 AM
Go it! I was not leaving a space after the last element in the 'WHERE'!:mad:

Stupid mistakes the hours it takes!

I have a site using "thinkding' works great!


Thanks for your help!

Robert

Charter
11-28-2003, 10:49 AM
Hi. Have you integrated PhpDig with the ThinkDing script? My plans are to do something like this for a future release of PhpDig.

Not Logged In
11-28-2003, 11:30 AM
I wish I knew how, willing to learn and help!