ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
$sql = "CREATE TABLE testTable (id int not null primary key auto_increment,
testField varchar (75))";
$result = mysql_query($sql, $conn) or die(mysql_error());
echo $result;
mysql_close();
?>
</body>
</html>
my apache error logs:
[Sat Mar 19 13:47:16 2005] [error] PHP Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2) in /var/www/htdocs/t.php on line 6
[Sat Mar 19 13:47:16 2005] [error] PHP Fatal error: Call to undefined function: mysql_create_db() in /var/www/htdocs/t.php on line 8
[Sat Mar 19 13:48:17 2005] [error] PHP Fatal error: Call to undefined function: mysql_create_db() in /var/www/htdocs/t.php on line 8
[Sat Mar 19 13:49:11 2005] [error] PHP Fatal error: Call to undefined function: mysql_create_db() in /var/www/htdocs/t.php on line 8
but using:
mysql -u root -p
>my password
mysql>
mysql> use mysql
Database changed
mysql> show tables;
+-----------------+
| Tables_in_mysql |
+-----------------+
| columns_priv |
| db |
| func |
| host |
| tables_priv |
| user |
+-----------------+
6 rows in set (0.00 sec)
if im working from the console, mysql is fine. wats the problem, the mysql.sock is also there!
gbonvehi, after installing mysql is there any configuration i need to do in order for mysql to work with php? or do u know some links (tutorial) for this?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.