Re: Select from 24 tables
| From: | John Nichel | Date: | Sat, 01 May 2004 20:05:11 +0000 |
| Subject: | Re: Select from 24 tables | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-185107@lists.php.net to get a copy of this message | ||
Dave Carrera wrote:
Hi List, How do I select data from 24 table in my database. Each one is identical in structure layout being Id,name,list I want to select where like $_POST[var] from a form all of the tables but I am having trouble :( I thought making a var string like $string = "table1,table2,table3,....."; And doing (select * from $string where list like \"%$_POST[var]%\"); Would work but I get a MySql error which say "Column: 'list' in where clause is ambiguous" I am stumped so I ask the list for help or advise please. Any advise is very much appreciated and I thank you in advance for any help or pointers. Thank you Dave CSELECT * FROM dbname.table1, dbname.table2, dbname.table3, ...etc WHERE table1.list LIKE '%$_POST['var']%', table2.list LIKE '%$_POST['var']%', table2.list LIKE '%$_POST['var']%', ...etc -- By-Tor.com It's all about the Rush http://www.by-tor.com