barney0o0 Posted December 3, 2008 Share Posted December 3, 2008 Hi Folks, im doing something wrong,...and my head hurts From a page link im sending test.php?Cat1=Sedie&Cat3=case In the test page i have the following msql $cat1 = $_GET['Cat1']; $cat3 = $_GET['Cat3']; $query_test = "SELECT * FROM product WHERE cat1 = '$cat1' AND '$cat3' = 'y' ORDER BY id ASC"; $test = mysql_query($query_test, $funari) or die(mysql_error()); $row_test = mysql_fetch_assoc($test); $totalRows_test = mysql_num_rows($test); however im not getting any results online (or error messages), even though the data is populated ...any ideas? Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/ Share on other sites More sharing options...
waterssaz Posted December 3, 2008 Share Posted December 3, 2008 forgive my ignorance. But have you tried to echo or print the results to the screen. Do you get anything then? If the above code is all your using then I wouldn't expect to see any results Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-704849 Share on other sites More sharing options...
barney0o0 Posted December 3, 2008 Author Share Posted December 3, 2008 yes, im printing the recordset results within the test.php page Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-704868 Share on other sites More sharing options...
waterssaz Posted December 3, 2008 Share Posted December 3, 2008 can you post the whole test page then if its not too long and I may be able to help :-) Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-704870 Share on other sites More sharing options...
barney0o0 Posted December 3, 2008 Author Share Posted December 3, 2008 cheers, however theres nothing wrong with the actual echo.....theres something wrong with the syntax/structure of the mysql query as it doesnt fetch results (in the first post) Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-704873 Share on other sites More sharing options...
waterssaz Posted December 3, 2008 Share Posted December 3, 2008 If it is a syntax error I am very surprised that you are not getting any error messages from error-reporting??? Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-704881 Share on other sites More sharing options...
fenway Posted December 4, 2008 Share Posted December 4, 2008 Sigh... use mysql_error() next time... you have your fields in single quotes. Quote Link to comment https://forums.phpfreaks.com/topic/135326-sending-variables-for-mysql/#findComment-706166 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.