|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
help with a SQL queries
hey everyone i have a database with multiple tables. The script involved is a news/journal/content management system.
What happens is once someone submits an article it rights to the table called 'entry' and populates all the fields specified in that table including a few variables that i want to use which are entry_author_id. in the other table which holds all the users there are a few fields that tie in with the entry_author_id. for instance the entry_author_id is called author_id in the table with the all the users information including their name(author_name). what i wanted to do is do a query in both tables and i want to carry over the value that entry_author_id holds and match it with author_id so that say if you have: 3 as the value in entry_author_id, and in the table with the author_id 3 is connected to user John Smith i wanted to carry over the value of entry_author_id so that variable pulls up the corresponding name to that number. any help will be appreciated. |
|
#2
|
|||
|
|||
|
RE: help with a SQL queries
I am guessing that you want to pull the authors name at the same time you pull the article? You could do something simple like:
SELECT entry.title, entry.article, authors.author_name FROM entry, article WHERE entry.entry_author_id = authors.author_id I obviously don't know all your table names and field names, but something like that would work.... |
|
#3
|
|||
|
|||
|
RE: help with a SQL queries
so i am able to assign variables within a query? so i can do something like this:
SELECT author_id, author_name FROM table_a, table_b WHERE author_id = author_name what i really wanted to do though is, in table_a once an entry is put it its given a history along with the author_id, in table_b it has all the users info including the author_id number that is assigned to a name. so if i make author_id = author_name in the query will that pull up correctly? |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > help with a SQL queries |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|