You are here: testing mysql « PHP SQL « IT news, forums, messages
testing mysql

Posted by Nospam on 04/28/06 22:12

i have apache 2.0.55, mysql 5.0.2 and php 5.1.2 I have gone through all the
steps, renaming phpinidist to php.ini and amending httpconf in the apache
folder with localhost, 127.0.0.1 admin email, however on running this sample
php script to determine if mysql is working fine:
<?
// connect to the server:
$cn = mysql_connect("127.0.0.1","root","pass");

// run a simple query
$sql = "SELECT 'done' as my_field LIMIT 1";
$result = mysql_query($sql,$cn);

if($result)
{
// if it worked, print the result to screen
echo mysql_result($result,"my_field");
} else {
// otherwise, either the server isn't running
// or the username/password are wrong
echo mysql_error()."<br />You should see an error message above you?";
}
?>

on running it with http://localhost/mysql.php

I receive Fatal error: Call to undefined function mysql_connect() in
C:\webroot\mysql.php on line 3

I am a little stuck as to where to go from now

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация