NYCPHP Meetup

NYPHP.org

[nycphp-talk] different sites, one database

Michael Johnson mike.johnson at wagner.edu
Wed Jul 13 12:56:07 EDT 2005


sounds like a mysql permissions problem, try this:

use mysql;
grant all privileges on <DB_NAME>.* to <DB_USER>@'%' identified by
'password';

if you're using PHP4:
set password for <DB_USER>@'%'=OLD_PASSWORD('password');

obviously set DB_NAME,DB_USER and password to your values;

p.s. you should also set a test for a successful connection before
trying to select, query, etc.:

$conn = mysql_connect(....);
if (!conn) die "Could not connect to database $db_name
REASON:".mysql_error();






More information about the talk mailing list