mdraft Posted July 12, 2006 Share Posted July 12, 2006 Hello,I'm a newbie to PHP and I'm struggling with making a change to my code. I would like to pull data from a different table in the same database. However, when I change the table reference to the other table (both the old and new tables are valid, existing tables), I get the following error:Unknown table 'CY Players' in field listThe following is the beginning of the code. I have highlighted the line that I would like to change from "PY Players" to "CY Players". Any ideas? Thanks!<?php //MODULE exec query (mysql 4.1 is required)// calc limits $in['limitQB'] = $in['teams']*$in['qbs'];$in['limitRB'] = $in['teams']*$in['rbs'];$in['limitWR'] = $in['teams']*$in['wrs'];$in['limitTE'] = $in['teams']*$in['tes'];// long select $sql="SELECT `CY All Players Combined Values`.Name, `CY All Players Combined Values`.Team, `CY Bye Week`.Bye, [color=red]`PY Players`.Consistency,[/color] `PY Players`.HC, `PY Players`.Fade, `CY All Players Combined Values`.Pos, `CY All Players Combined Values`.Expr1 AS `Avg Starter`, `CY All Players Combined Values`.Expr2 AS `Min Starter`, `CY All Players Combined Values`.Expr3 AS `StdDev Starter`, `CY Fantasy Pts Sorted`.`Total FP` AS `This Yr Proj`, `CY Fantasy Pts Sorted`.`Total FP`/`PY Fantasy Pts`.`Total FP`*100 AS `% of Last Yr` Quote Link to comment https://forums.phpfreaks.com/topic/14401-query-cant-find-mysql-table/ Share on other sites More sharing options...
fenway Posted July 12, 2006 Share Posted July 12, 2006 I won't even ask why your table names have spaces in them... but apparently, such a table doesn't exist, as far as MySQL is concerned. Post the SHOW TABLES output. Quote Link to comment https://forums.phpfreaks.com/topic/14401-query-cant-find-mysql-table/#findComment-56883 Share on other sites More sharing options...
mdraft Posted July 12, 2006 Author Share Posted July 12, 2006 The following is the result given for SHOW TABLES.Thanks for any help you can give me.SQL query SQL query: SHOW TABLES [ Edit ] [ Create PHP Code ] [ Refresh ] Tables_in_m0n_projections CY All Statistics CY Bye Week CY Players PY All Statistics PY Bye Week PY Players item_table paypal_table Quote Link to comment https://forums.phpfreaks.com/topic/14401-query-cant-find-mysql-table/#findComment-56964 Share on other sites More sharing options...
fenway Posted July 12, 2006 Share Posted July 12, 2006 Well, the table is there... post your complete query; my guess is you haven't included that table. Quote Link to comment https://forums.phpfreaks.com/topic/14401-query-cant-find-mysql-table/#findComment-56991 Share on other sites More sharing options...
mdraft Posted July 13, 2006 Author Share Posted July 13, 2006 Thanks for your help. I found that I had missed a "join" command that needed to be changed.Thanks again! Quote Link to comment https://forums.phpfreaks.com/topic/14401-query-cant-find-mysql-table/#findComment-57034 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.