|
| |||||||
![]() | Welcome to iWEBTOOL Talk, where you talk about
webmaster-related stuff.
1 Register
2 Browse the board
3 Discuss whatever may interest you! | |||||||||||||
![]() |
| | Thread Tools | Search this Thread | Display Modes |
| | #1 |
| Smurf Join Date: Mar 2008
Posts: 1
![]() | Hi everyone, I run w/o problem: $query = 'SELECT * FROM customers_table WHERE customer_id=\''.$customer_id.'\' '; I need to replace the tablename called "customers_table" above with a variable, e.g. $table = 'customers_table'; $query = 'SELECT * FROM $table WHERE customer_id=\''.$customer_id.'\' '; It report's error. I have tried also this way: define("CUSTOMERS_TABLE", "customers_table"); $query = 'SELECT * FROM CUSTOMERS_TABLE WHERE customer_id=\''.$customer_id.'\' '; It report's error, but if I write CUSTOMERS_TABLE in lowercase, all is OK. The purpose is to have more entries into program and onetime I use define("CUSTOMERS_TABLE", "customers_table"); nextime will be define("CUSTOMERS_TABLE", "peters_table"); and next time define("CUSTOMERS_TABLE", "alices_table"); and so far... Can you help how to write $query = ... correctly? |
| | |
|
| |||||||
| | #2 |
| Senior Member | Code:
Try that.
__________________ Intripita :: web hosting | development | conferencing Business-Grade Web Hosting, Professional Conferencing, Effective Web Development by Intripita |
| | |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| table not expanding | wwe9112 | HTML | 2 | 02-23-2008 12:30 PM |
| Changing multiple Table entries? | marcusa007 | PHP | 2 | 05-06-2007 10:07 PM |
| What do you think how Google PR DB table looks like? | 123_free_links | 10 | 04-30-2007 03:52 PM | |
| Table within a table | jumpenjuhosaphat | PHP | 5 | 08-05-2006 11:20 PM |
| New table builder web tool 3w.ezer.com | 123_free_links | Website Reviews | 4 | 06-26-2006 11:26 AM |