PHP and MySQL in YDL 3.0
Dorothy over the RGB
yellowdog-general@lists.terrasoftsolutions.com
Wed Jun 4 04:55:01 2003
The problem with distribution installation is that you never know where they
are going to put the things:
(a) Check /etc/php.d/mysql.ini
It should say something like:
; Enable mysql extension module
extension=mysql.so
(b) Check that you have mysql.so there:
/usr/lib/php4/mysql.so
(c) I never used phpMySQLAdmin but I think I remember that there is some
configuration to do in one of their scripts. Otherwise you may want to try
the simple thing below until you get the connections working:
<html>
<head>
<title>Test MySQL</title>
</head>
<body>
<?php
function mysql_debug($query=""){
$err=mysql_errno();
$errStr=mysql_error();
if($err || ($errStr!="")){
print("<br />*** MySQL error:
".$err.", ".$errStr.", ".$query);
}
}
$connection=mysql_connect("localhost","root",""); //
Replace with correct values here
mysql_debug();
mysql_select_db("mysql",$connection);
mysql_debug();
$result=mysql_query("SHOW TABLES",$connection);
$num_rows=mysql_num_rows($result);
for($row=0;$row<$num_rows;$row++){
$row_data=mysql_fetch_row($result);
print("<br />".$row_data[0]);
}
mysql_free_result($result);
?>
</body>
</html>
Personally I think it is faster to compile from source and put your stuff
together in /usr/local/apache, /usr/local/mysql,... instead of spreading the
pieces over lib, var, etc and so on, especially when each distro spreads the
things differently from the others. It's a personal opinion though.