mrsrowe Posted December 23, 2007 Share Posted December 23, 2007 Hello Im only an occaisional user of php and mysql, so I forget stuff, but this is driving me insane I have a form on an html page, i have a drop down which allows users to select a search term, the search term is sent to a php page; which takes the value and turns it into a variable, $valx i want to use this value to search for the term in my db. this is my query: "SELECT Doc, Abstract, Topic, DATE_FORMAT(pubYear, '%Y') AS MyYear, Keywords FROM tblDoc WHERE Topic LIKE $valx ORDER BY MyYear DESC"; This is returning nothing what so ever. In order to test if the variable was working did this echo "selected text was $valx"; which works I have tried substituting the variable for an actual value in the quey, for example "water" this returns all of the results, but I cannot get it to return the results when I use the value. I am completely flummoxed by this and any help that can be offered would be really appreciated. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/82908-solved-does-not-return-result-on-page-but-does-from-db/ Share on other sites More sharing options...
mrsrowe Posted December 23, 2007 Author Share Posted December 23, 2007 stupid me, using wrong kind of "" marks grr Quote Link to comment https://forums.phpfreaks.com/topic/82908-solved-does-not-return-result-on-page-but-does-from-db/#findComment-421635 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.