RE: [PHP-DB] selecting a constant or label in php
| From: | Jon Davis | Date: | Wed, 03 Dec 2003 16:36:14 +0000 |
| Subject: | RE: [PHP-DB] selecting a constant or label in php | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-31869@lists.php.net to get a copy of this message | ||
COMM_REGIONID and COMM_TRKGRP are not columns in the tables. They are the actual table names. I want the count of the PHYSICAL_ID where it is NULL. I need to do this for multiple table so I want to hardcode the tablename and then have the count:
------------ -----------
COMM_TKGRP 0 COMM_REGIONID 0using "COMM_REGIONID", 'COMM_REGIONID' and \"COMM_REGIONID\" all fail with: Warning: sybase_query() [http://www.php.net/function.sybase-query]: Sybase: Server message: COMM_REGIONID not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output). It's not found because it's not a column. I just want it in there so when I insert it into another table I will know which count applies to which table. Everything I try, gets an error. Sorry, I should have mentioned what COMM_REGIONID was first.
From: "Jon Davis" <jonwdavis@hotmail.com> To: php-db@lists.php.net Subject: [PHP-DB] selecting a constant or label in php Date: Wed, 03 Dec 2003 09:39:33 -0600 Sorry for another newbie question, I'm learning. In Sybase I can do: select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null select "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null I get parsing errors when putting it in this: $result = sybase_query("select "COMM_REGIONID" , count(1) from COMM_REGIONID where PHYSICAL_ID is null_________________________________________________________________ Get holiday tips for festive fun. http://special.msn.com/network/happyholidays.armxselect "COMM_TKGRP" , count(1) from COMM_TKGRP where PHYSICAL_ID is null" , $server_sybase);How can I hardcode "COMM_REGIONID" and "COMM_TRKGRP"? _________________________________________________________________ Wonder if the latest virus has gotten to your computer? Find out. Run the FREE McAfee online computer scan! http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php