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 Link to comment https://forums.phpfreaks.com/topic/106710-any-help-on-this-query-would-be-great/ 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? Link to comment https://forums.phpfreaks.com/topic/106710-any-help-on-this-query-would-be-great/#findComment-547110 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 Link to comment https://forums.phpfreaks.com/topic/106710-any-help-on-this-query-would-be-great/#findComment-547424 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 Link to comment https://forums.phpfreaks.com/topic/106710-any-help-on-this-query-would-be-great/#findComment-547507 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"; Link to comment https://forums.phpfreaks.com/topic/106710-any-help-on-this-query-would-be-great/#findComment-547929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.