Jump to content


Photo

MySql won't work


  • Please log in to reply
12 replies to this topic

#1 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 02:28 PM

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...all-apache.html




#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 02 September 2006 - 02:45 PM

Did you install SQLite or MySQL? Does your server support php5?
Legend has it that reading the manual never killed anyone.
My site

#3 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 03:11 PM

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.

#4 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 04:12 PM

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
.

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 04:18 PM

Those errors are usually caused by missing semi-colons at end of lines.

Post you code here.

#6 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 06:01 PM

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


#7 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 02 September 2006 - 06:05 PM

Change mysql-select_db to mysql_select_db ... underscore not minus :)
Legend has it that reading the manual never killed anyone.
My site

#8 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 September 2006 - 06:10 PM

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.

#9 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 02 September 2006 - 08:26 PM

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 5. Some extra steps: Setting up a development environment and installing MySQL 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.

#10 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 September 2006 - 10:10 AM

I enabled it, but it still doesn't work.

#11 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 September 2006 - 11:29 AM

OKay. Is PHP using using the correct php.ini. You can check this by running the phpinfo() function in phpscript:
<?php
phpinfo();
?>

Look for the Configuration File (php.ini) Path 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.

#12 uneatblepie

uneatblepie
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 September 2006 - 11:46 AM

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?


#13 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 September 2006 - 11:59 AM

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users