Canman2005 Posted November 15, 2008 Share Posted November 15, 2008 Hi all I have the following query SELECT SUM(x.type_price) AS total FROM (SELECT DISTINCT type_uid, type_price FROM cart_log WHERE `unique_id`= '76202714-20081115-1239-125853-15364793' AND `type_type` = 4) AS X but getting error #1109 - Unknown table 'x' in field list Any ideas? Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/ Share on other sites More sharing options...
Mchl Posted November 15, 2008 Share Posted November 15, 2008 x and X are not the same for MySQL Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690906 Share on other sites More sharing options...
Canman2005 Posted November 15, 2008 Author Share Posted November 15, 2008 Ok, but running it through a php QUERY gives me Warning: mysql_result(): supplied argument is not a valid MySQL result resource in even if rows exist that contain data Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690907 Share on other sites More sharing options...
Barand Posted November 15, 2008 Share Posted November 15, 2008 x and X are not the same for MySQL works for winXP http://www.phpfreaks.com/forums/index.php/topic,225481.msg1039874.html#msg1039874 Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690909 Share on other sites More sharing options...
Canman2005 Posted November 15, 2008 Author Share Posted November 15, 2008 Sorry for double posting Barand I'm a little bit lost on what you mean, I have done that QUERY and it runs fine locally on my test server, but on a live server I get that error. Not too sure what you mean by "x and X are not the same for MySQL" any help would be appreciated Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690912 Share on other sites More sharing options...
Barand Posted November 15, 2008 Share Posted November 15, 2008 try changing x to X in the query. Some Op systems are case sensitive. PS What does mysql_error() give? Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690914 Share on other sites More sharing options...
Canman2005 Posted November 15, 2008 Author Share Posted November 15, 2008 and by magic it works thanks man Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690916 Share on other sites More sharing options...
Barand Posted November 15, 2008 Share Posted November 15, 2008 I did suggest the X/x might be case sensitive in your original thread Link to comment https://forums.phpfreaks.com/topic/132850-solved-php-query-help/#findComment-690918 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.