without detailed knowledge no, I can't help, and I'm guessing no one else can give a defintive answer
what error meesages are you getting
hint look at the php construct of
<php statement> or die (error message)
I often use soemthing similar to...
Code:
$cnn=@mysql_connect($host,$UID1,$PWD1) or die("E:xxxx - Failed to open cn:$cnn ".mysql_errno().": ".mysql_error()));
$dbr=@mysql_select_db($dbn,$cnn) or die ("E:yyyy - Failed to open db:$dbr ".mysql_errno().": ".mysql_error()));
$sql = "
Select * from DT_Event
where Event_End>=curdate() or (Event_End is Null and Event_Start>-curdate())
order by Event_Start,Event_End,Event_Name";
// where Event_End>=curdate()
$sqlr=@mysql_query($sql,$cnn) or die ("E:zzzz - Failed to open rs:$sqlr ".mysql_errno().": ".mysql_error()));
if (@mysql_num_rows($sqlr)>0) {
} else
{ //insert debug mesage to show no records returned
}
my first / best guess is going to be that you probabkly haven't given the correct permissions to the web userid. if so check you grants
failing that it could be that the mysql isnt running on your machine. check you can use MysQL adminsitrator
check that MySQL runs on ther command line / shell
there are ffectively 3 steps to ensure the php module is "talking" to the db server
the connection - fails if permissionsa arn't correct
the database -fails if the db isn't working, or if the permissions aren't correct
the sql - fails if the SQL isn't valid.
in nay event you need to know what is causing the problem - examining the mysqlerrno() and mysqlerror() should give a clue.
like all software products occasionally the error message can be a bit cryptic but it will point you nt he right direction.
if you can run mysql admin or mysql query browser AND connect tohe locsal host then by defintion the server is active that demonstrates the problem is likely to be in the permissions ofr th euser account and password specified. in this event either GRANT permissions or use mysql admin to handle the permissions
aftert that it becoems a PHP problem, and youmay be better off asking the question on the php thread rather than the MySQL thread.
HTH