If I simply run the SQL statement from phpadmin (same user, same db)
and
it works providing the expected result (see http://i30.tinypic.com/10oqlhg.jpg)
but If I run it from php/mysql I'm getting the error 1146 - Table
'mysql.proc' doesn't exist.
Initially I went through the MySQL forums and docs and found that it
is a known problem in case of migrations from previous versions of
MySQL but then I tested through the phpadmin and in that case it
worked... which would mean to me that the mysql-db is properly
configured....
Any help is really appreciated.
Here is the sample code :
$db = mysql_connect($host,$user,$password) or die ("DB connection
error: ".mysql_error());
mysql_select_db($db_name, $db) or die ("DB selection errore:
".mysql_error());
function testit ($q) {
echo "Query: <b>" . $q . "</b><br>\n";
$r=mysql_query($q);
print "RESULT: " .$r ."<br>\n";
print "ERROR (" . mysql_errno() . "): " .mysql_error() ."<br><hr>\n";
}
testit ("SELECT * from events");
testit ("SELECT GET_LOCK ('events.test', 20)");
which outputs the following:
Query: SELECT * from events
RESULT: Resource id #4
ERROR (0):
Query: SELECT GET_LOCK ('events.test', 20)
RESULT:
ERROR (1146): Table 'mysql.proc' doesn't exist
hat immediately springs to mind is the difference between localhost
and 127.0.0.1 - i.e. connecting via an internet socket and filesystem
socket. I suspect that if you replicate the connection type from
phpmyadmin in your PHP code, it will work (or check the procs_priv,
db, user and host tables in the mysql database)
C.
Please don't multipost. If you have to post to multiple newsgroups,
please crosspost.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================
I tried to provide to mysql_connect both localhost and 127.0.0.1
but I got the same problem.
Very strangely when connecting locally (using mysql client) (with and
without -h option)
I had the first time the error while all the other tests (even
repeating the failing test) it worked...
But from PHP it didn't work ever...
As I said - please do not multipost! Crosspost instead.
This is being discussed in comp.databases.mysql.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================