In the begining
Posted by: arogance (---.interbild.net)
Date: February 09, 2006 02:32PM

Hi!
I install wamp.
Then i created i new database, with 1 table and only one row in the table.
Then i try to connect to my database :
<?php
$link = mysql_connect("localhost","root","1234"winking smiley;
if (!$link) {
die('Not connected : ' . mysql_error());
}

$db_selected = mysql_select_db("guestbook",$link);
if (!$db_selected) {
die ('Can\'t use guestbook : ' . mysql_error());
}
?>
and it doesn't work.
The error msg is: Fatal error: Call to undefined function mysql_connect() in C:\wamp\www\Project _1\_debug_tmp.php on line 2
And idon't know how to use php in wamp, that's why i install php designer.
I use windows.
I realy wanna undurstand this.

Options: ReplyQuote
Re: In the begining
Posted by: Oscarin (---.prod-infinitum.com.mx)
Date: February 16, 2006 05:51AM

Try turning on... "short_open_tag = on"..... on the php.ini file.

Options: ReplyQuote
Re: In the begining
Posted by: CyberSpatium (---.hsd1.or.comcast.net)
Date: February 16, 2006 07:36AM

"Try turning on... "short_open_tag = on"..... on the php.ini file" - no, this has nothing to do with your problem. You are getting this error because your are using the newest version of MySQL which uses the new mysqli_connect to connect to the database, not the old mysql_connect version.

Change this line:
$link = mysql_connect("localhost","root","1234"winking smiley;

To this:
$link = mysqli_connect("localhost","root","1234"winking smiley;


And change this line:
$db_selected = mysql_select_db("guestbook",$link);

To this:
$db_selected = mysql_select_db("guestbook",$link);

Also, if you are having probmels getting phpmyadmin to work too, open up your phpmyadmin config.ini.php file, and arround line 61 you will see this setting:

$cfg['Servers'][$i]['extension'] = 'mysql';

change this line to:
$cfg['Servers'][$i]['extension'] = 'mysqli';


Options: ReplyQuote


Sorry, only registered users may post in this forum.