View Single Post
  #4 (permalink)  
Old Jan 27th, 2008, 09:11
Jack Franklin's Avatar
Jack Franklin Jack Franklin is offline
Resources Administrator

SuperMember
Join Date: May 2007
Location: Cornwall, England
Posts: 1,265
Blog Entries: 7
Thanks: 10
Thanked 4 Times in 4 Posts
Re: Seraching inside all tables

Code: Select all
 
(Connect to your db) and then:
 
SELECT * FROM table1, table2, table3, etc (add your tables here) WHERE name='Felix'
So in PHP:
PHP: Select all

$sql "SELECT * FROM table1, table2, etc WHERE name='Felix'";
if (
$sql) {
echo 
'all done';
} else {
echo 
'error';

Try that?

Remembering first you need to connect to the database:
PHP: Select all

# DataBase Settings
$hostname_config "localhost";     # 99% Leave Localhost
$database_config "";   # Database Name
$username_config "";   # Database Username
$password_config "";    # Password 
$conn mysql_connect($hostname_config$username_config$password_config) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_config)or die(mysql_error()); 

Last edited by Jack Franklin; Jan 27th, 2008 at 09:13.
Reply With Quote