Ansel_Tk1 Posted May 22, 2008 Share Posted May 22, 2008 Hi - obvious noob... trying to combine 2 conditions on a query: SELECT * FROM vidsys1_programflv_list WHERE video_pages LIKE %colname% AND vidsys1_programflv_list.video_client = colname2 ORDER BY video_order ASC Where colname=$_GET['pg'] and colname2=$SESSION['kt_home_page'] Any help would be appreciated. tx Quote Link to comment Share on other sites More sharing options...
bobinindia Posted May 22, 2008 Share Posted May 22, 2008 I assuming this is a typo: $session should be $_SESSION. you mention this as a table name: vidsys1_programflv_list Is video pages also a table name by any chance? Quote Link to comment Share on other sites More sharing options...
Ansel_Tk1 Posted May 22, 2008 Author Share Posted May 22, 2008 Hi - thanks bobinindia both video_client and video_pages are fields in the table vidsys1_programflv_list Dan Quote Link to comment Share on other sites More sharing options...
bobinindia Posted May 22, 2008 Share Posted May 22, 2008 i am a beginner really myself but as no one is answering. I don't think you need to mention the table twice vidsys1_programflv_list.video_client should just be video_client Passing thought. Good luck Quote Link to comment Share on other sites More sharing options...
Barand Posted May 23, 2008 Share Posted May 23, 2008 use quotes round string values $sql = "SELECT * FROM vidsys1_programflv_list WHERE video_pages LIKE '%$colname%' AND video_client = '$colname2' ORDER BY video_order ASC"; 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.