input articleIDs
ok, bear with me, this is the newbie section and i did do another 4 hours of fail since my last post so, here it goes, i finally made a database called "log"
got the tables_in_log to show: articles searchwords heck, i can even input queries: insert into articles values(0, 'log' '8/30/10 zcaptain '); insert into searchWords values(0, 'log', '1'); insert into searchWords values(0, 'ahsim', '1'); insert into articles values(0, 'home', 'home page'); insert into searchWords values(0, 'home', '2'); etc etc all show query, OK 1 row affected. but when i run a search for say,"log" in my new snazzy search box (courtesy of Whim sturkenboom in my php parshe error link down the page) and it runs the search but returns: Query select articleIds from searchWords where word = 'log' failed: Unknown column 'articleIds' in 'field list' please alleviate my blinding stupidity! much thanks for reading such a long post |
input articleIDs
ok, bear with me, this is the newbie section and i did do another 4 hours of fail since my last post so, here it goes,
with mysql vers 5.1.36, i finally made a database called "log" got the tables_in_log to show: articles searchwords heck, i can even input queries: insert into articles values(0, 'log' '8/30/10 zcaptain '); insert into searchWords values(0, 'log', '1'); insert into searchWords values(0, 'ahsim', '1'); insert into articles values(0, 'home', 'home page'); insert into searchWords values(0, 'home', '2'); etc etc all show query, OK 1 row affected. but when i run a search for say,"log" in my new snazzy search box (courtesy of Whim sturkenboom in my php parshe error link down the page) and it runs the search but returns: Query select articleIds from searchWords where word = 'log' failed: Unknown column 'articleIds' in 'field list' please alleviate my blinding stupidity! much thanks for reading such a long post |
Hi -
Please cut/paste: a) your exact "select" query b) "describe YOUR_TABLE" (substute your actual table name for "YOUR_TABLE") c) the exact error d) use "code blocks" when you cut/paste TIA! |
Please see the other post.
Even if you solved the problem, please cut/paste your original query (and how you solved it) so others can learn. TIA! |
exact error:
Query select articleIds from searchWords where word = 'homepage' failed: Unknown column 'articleIds' in 'field list' so, article Id's isnt in my field, but i cant find a way to put them there hard to copy paste from mysql lol, Code:
SHOW database *results in*: ----------- sry for the inconvinence |
Quote:
Code:
-----\-----------\-------\-------\--------\---------\ |
grok
Quote:
but searchwords still no go, same input, same error |
Here's what I was trying to ask you:
1. Please Cut/paste exact query (use LQ "code blocks"): Code:
select articleIds from searchWords where word = 'homepage'; Code:
-----\-----------\-------\-------\--------\---------\ Code:
Query select articleIds from searchWords where word = 'homepage' failed: Unknown column 'articleIds' in 'field list' As Hangdog42 said: you're asking for something that doesn't exist! Here's are a couple of alternative queries that should work: Code:
select wordId from searchWords where word = 'homepage'; PS: I'm assuming your table is called "searchwords", and not "articleId". If you had a table for articles, I'd call it "Articles", or "ArticlesTable"; and "articleId" (or simply "id") would be a COLUMN in your "Articles" table. PPS: I've found this book very helpful for learning SQL: Quote:
|
Quote:
Having a table "articlesId" isn't the problem here. Let's parse your query: Quote:
|
i am not asking for a handout, i have been and continue to try, but, ive been stumped for a day and a half, over something other forums wont help w/
----------------------------------- alright, so, i know its requesting a column article ids that dont exist. i 'll include the entire mysql i had done initially, Code:
create database log; Code:
insert into articles values(0, 'log', 'ahsim zcaptain'); Code:
insert into searchWords values(0, 'log', '1'); Code:
select wordId from searchWords where word = 'homepage'; Code:
select * from searchwords; Code:
select * from searchwords where word = 'homepage'; Code:
"select wordId, word, article from searchwords where word like 'home%';" now, obviously every time i "insert search word" it registered:D i just need to know how to add the proper column (articleId?), and /or affect the column in the right area, clear all my old homes zcaptain's and the like basically, i just figured if i wanted to search the word "log" and have it find it, id just: insert intoarticle values (0, log, "1") but, since ahsim or zcaptain,are also (0, *, "1") i wanted a search of them to grab log as well, and a search home or homepage, to both pull the same page since theyre both "2" is that flawed? I appreciate all the effort you guys are investing in attempting to enlightenin this fool. |
ive been trying to modify the existing searchwords table to include field (articleId)
still no prevailance |
I think this is starting to make some more sense, but I've still got a couple of questions:
- When you create the searchwords table, you create an articleIds field. However, in your dump of the table (select * from searchwords) the field appears as "article". That isn't necessarily a fatal flaw so long as your SQL statements use article. -Am I correct in assuming that the article field in searchwords is the same data as articleID in the articles table? Assuming this is the case, the following might do what I think you're after Code:
SELECT a.articleID FROM articles a, searchwords b WHERE b.word='homepage' AND a.articleID=b.article |
All times are GMT -5. The time now is 02:34 PM. |