cl4im3r Posted June 8, 2008 Share Posted June 8, 2008 Hi, Thnx for your time, very much appreciated. First of all, i should explain that, the result i'm trying to achieve, is to change a URL from originally looking like this... site.com/article.php?id_art=155 And make it look like this... site.com/article.php?title_art=example_title Here is the mysql for the original "id_art" result. (copied & pasted from dreamweaver) SELECT * FROM blg_article_art INNER JOIN blg_topic_top ON idtop_art=id_top WHERE id_art = colname name: colname DefaultValue: -1 Run-TimeValue: $_GET['id_art'] This code worked correctly. But when i changed it to this "title_art" version... SELECT * FROM blg_article_art INNER JOIN blg_topic_top ON idtop_art=id_top WHERE title_art = colname name: colname DefaultValue: -1 Run-TimeValue: $_GET['title_art'] It doesnt work, and when i click on a link which for example say's.. site.com/article.php?title_art=example_title I recieve the following SQL Error: Unknown column 'example_title' in 'where clause' I am completely at a loss, racking my brain, as to what i need to change. I've also tried changing the "Default Value" from -1 to Null. But still no results. Does anyone have some sought of idea, as to what is going wrong? Thnx alot Dan Quote Link to comment Share on other sites More sharing options...
Buddski Posted June 8, 2008 Share Posted June 8, 2008 That error is caused by the `example_title` column not being in the Database.. What is the script your using to run the query.? Quote Link to comment Share on other sites More sharing options...
cl4im3r Posted June 8, 2008 Author Share Posted June 8, 2008 Thnx for your reply, i'm not a techy, so i'll answer the best i can. The actual Column name is 'Title_art' 'Example Title' is just one of my rows, within the 'title_art' Column. 'title art' is certainly in my database, aswell as the particular row named 'Example Title'. As for what Script i'm using, are u reffering to "innoDB"? I'm sorry i'm just a pitiful designer. If you could give me an example of some scripts, i'm sure i can answer that. WHERE title_art = colname name: colname DefaultValue: -1 Run-TimeValue: $_GET['title_art'] As you can see, for default value, i've written -1. But my title_art column is not numeric, could there possibly be something else i should put there instead? Thnx for your patience. Quote Link to comment Share on other sites More sharing options...
cl4im3r Posted June 8, 2008 Author Share Posted June 8, 2008 Someone gave me the solution! WHERE title_art = colname Should be... WHERE title_art = 'colname' I've been trying to fix this for 3 days... Unbelievable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.