Fatal error

right now, im migrating to php5… i opened my script in php 4 and there’s a message…

Fatal error: Call to undefined function mysql_connect() in D:\WEBSITES\steco\includes\konek.php on line 7

this is my konek.php

<?php
$dbname="stecodb";
$dbuser="root";
$dbpass="";
$dbhost="localhost";

$db=mysql_connect("$dbhost","$dbuser","$dbpass")
or die("Could not connect");

mysql_select_db("$dbname",$db) 
or die ("Could not open db");
?>

can anyone tell me what’s wrong with my connection? tnx… rok on!!!

It means the php version you are using on the server has not been compiled with mysql support (hence no function exists to talk to mysql). If you are able to compile it yourself on the server you need the –with-mysql switch in your ./configure line. Also, the obvious point, make sure you have mysql installed on the server.

Well I don’t know about PHP5, but I know that you arent supposed to put variables between " ". Try this:


$db=mysql_connect($dbhost,$dbuser,$dbpass)

The double quote’s shouldn’t matter, but yeah - it’s highly unecessary (must have missed than when I first looked at it)