Jump to content

Archived

This topic is now archived and is closed to further replies.

uneatblepie

MySql won't work

Recommended Posts

I installed the latest version of MySql, but when i test code it writes:
Fatal error: Call to undefined function sqlite_open() in C:\Program Files\Apache Group\Apache2\htdocs\cooks.php on line 17.
I don't really know anything about MySql.
just tried to follow this:
http://www.expertsrt.com/tutorials/Matt/install-apache.html


Share this post


Link to post
Share on other sites
Did you install SQLite or MySQL? Does your server support php5?

Share this post


Link to post
Share on other sites
You cannot run the sqlite functions with the MySQL database/extensions. The sqlite functions work with the sqlite extension (php_sqlite.dll) and the sqlite database serer.

If you want to query a mysql database use the mysql functions. Make sure you have enabled the mysql extension (php_mysql.dll) too if are running PHP5. - This is explained in the tutorial you linked to.

Share this post


Link to post
Share on other sites
enabled it.
My server does support php5,its something with mysql.
now i get this in another code:
Parse error: parse error, unexpected T_VARIABLE in C:\Program Files\Apache Group\Apache2\htdocs\counter.php on line 2
or
Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\counter.php on line 3
.

Share this post


Link to post
Share on other sites
Those errors are usually caused by missing semi-colons at end of lines.

Post you code here.

Share this post


Link to post
Share on other sites
just copied a code and edited it because,the variables were Unexpected.
<? php
mysql_connect("localhost","username","password")or die("cannot connect");
mysql-select_db("db_name")or die("cannot select database");
?>
or
<? php
mysql_connect("localhost","username","password")or die("cannot connect");
mysql-select_db("db_name")or die("cannot select database");
?>
the same thing.-Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Group\Apache2\htdocs\counter.php on line 3

Share this post


Link to post
Share on other sites
Change mysql-select_db to mysql[b][color=red][size=10pt]_[/size][/color][/b]select_db ... underscore not minus :)

Share this post


Link to post
Share on other sites
Damn!I feel like an idiot.
When there all in notepad, one underneath each other,its hard for me to notice it.
...still, the error seems to be in tine 3.
EDIT:
i have the feeling that my MySql doesn't works AT All.
i tried deleting the upper code, but the error remains the same.
EDIT:
yep!
php info doesn't even have a MySql section.
Ill try to re-install it.

Share this post


Link to post
Share on other sites
You dont need to reinstall MySQL. If you ahve PHP5, which it sound like you do need to enable the MySQL extension.

Go to the [url=http://www.expertsrt.com/tutorials/Matt/install-apache.html#extras]5. Some extra steps: Setting up a development environment and installing MySQL[/url] heading. Now scroll down to the MySQL heading read from then on. Fter it talks about installing mysql it talks about enabling the MySQL extension.

Share this post


Link to post
Share on other sites
OKay. Is PHP using using the correct php.ini. You can check this by running the phpinfo() function in phpscript:
[code=php:0]<?php
phpinfo();
?>[/code]

Look for the [b]Configuration File (php.ini) Path[/b] row. To the right that should be the path to the php.ini it using. Is this the correct path?

Also make sure you are restarting the server too when making any changes to the php.ini.

Share this post


Link to post
Share on other sites
Its  sais it is in C:/windows......htere is a php.ini file there, but i'm not sure its right....How can i change the path?

Share this post


Link to post
Share on other sites
Where is your php.ini located to. Move your php.ini to C:\WINDOWS\ (or C:\WINNT\ if WINDOWS doesnt exist). Restart your server. Is PHP using the correct ini now?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.