I am a newbie
please help
When I run phpinfo() I get the following configure
command.
This tells me that mysql is installed.
Configure Command
'./configure' 'i386-redhat-linux' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec'
'--localstatedir=/var' '--sharedstatedir=/usr/com'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--prefix=/usr' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug'
'--enable-dbg=shared' '--with-dbg-profiler'
'--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2'
'--with-db3' '--with-curl' '--with-dom=/usr'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd'
'--enable-gd-native-ttf' '--with-ttf' '--with-gdbm'
'--with-gettext' '--with-ncurses' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-mm'
'--with-openssl' '--with-png' '--with-pspell'
'--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath'
'--enable-debugger' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-discard-path'
'--enable-track-vars' '--enable-trans-sid'
'--enable-yp' '--enable-wddx' '--without-oci8'
'--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared'
'--with-snmp=shared,/usr' '--with-snmp=shared'
'--enable-ucd-snmp-hack' '--with-unixODBC=shared '
'--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning'
'--enable-calendar' '--enable-dbx' '--enable-dio'
'--enable-mcal' '--enable-mbstring'
'--enable-mbstr-enc-trans'
'--with-apxs=/usr/sbin/apxs'
However when I run the following script I get the
following error:
Fatal error: Call to undefined function:
mysql_connect() in /var/www/html/db_connect.php on
line 4
*----------------this is my script
----------------------------------------------
<?php
echo '21111221';
$connection = mysql_connect(" localhost", "", "");
echo mysql_error();
echo mysql_errno();
// or die("Couldn't connect, reason".mysql_e rror());
echo '22222';
if ($connection) {
$msg = "Success!";
}
else {
$msg = "Not connected";
}
?>
<HTML>
<HEAD>
<TITLE>MySQL Connection</TITLE>
</HEAD>
<BODY>
<?php echo "$msg"; ?>
</BODY>
</HTML>
*----------------end of script
----------------------------------------------
please help
When I run phpinfo() I get the following configure
command.
This tells me that mysql is installed.
Configure Command
'./configure' 'i386-redhat-linux' '--prefix=/usr'
'--exec-prefix=/usr' '--bindir=/usr/bin'
'--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include'
'--libdir=/usr/lib' '--libexecdir=/usr/libexec'
'--localstatedir=/var' '--sharedstatedir=/usr/com'
'--mandir=/usr/share/man' '--infodir=/usr/share/info'
'--prefix=/usr' '--with-config-file-path=/etc'
'--enable-force-cgi-redirect' '--disable-debug'
'--enable-dbg=shared' '--with-dbg-profiler'
'--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-bz2'
'--with-db3' '--with-curl' '--with-dom=/usr'
'--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr'
'--with-png-dir=/usr' '--with-gd'
'--enable-gd-native-ttf' '--with-ttf' '--with-gdbm'
'--with-gettext' '--with-ncurses' '--with-gmp'
'--with-iconv' '--with-jpeg-dir=/usr' '--with-mm'
'--with-openssl' '--with-png' '--with-pspell'
'--with-regex=system' '--with-xml'
'--with-expat-dir=/usr' '--with-zlib'
'--with-layout=GNU' '--enable-bcmath'
'--enable-debugger' '--enable-exif' '--enable-ftp'
'--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem'
'--enable-sysvshm' '--enable-discard-path'
'--enable-track-vars' '--enable-trans-sid'
'--enable-yp' '--enable-wddx' '--without-oci8'
'--with-imap=shared' '--with-imap-ssl'
'--with-kerberos=/usr/kerberos' '--with-ldap=shared'
'--with-mysql=shared,/usr' '--with-pgsql=shared'
'--with-snmp=shared,/usr' '--with-snmp=shared'
'--enable-ucd-snmp-hack' '--with-unixODBC=shared '
'--enable-memory-limit' '--enable-bcmath'
'--enable-shmop' '--enable-versioning'
'--enable-calendar' '--enable-dbx' '--enable-dio'
'--enable-mcal' '--enable-mbstring'
'--enable-mbstr-enc-trans'
'--with-apxs=/usr/sbin/apxs'
However when I run the following script I get the
following error:
Fatal error: Call to undefined function:
mysql_connect() in /var/www/html/db_connect.php on
line 4
*----------------this is my script
----------------------------------------------
<?php
echo '21111221';
$connection = mysql_connect(" localhost", "", "");
echo mysql_error();
echo mysql_errno();
// or die("Couldn't connect, reason".mysql_e rror());
echo '22222';
if ($connection) {
$msg = "Success!";
}
else {
$msg = "Not connected";
}
?>
<HTML>
<HEAD>
<TITLE>MySQL Connection</TITLE>
</HEAD>
<BODY>
<?php echo "$msg"; ?>
</BODY>
</HTML>
*----------------end of script
----------------------------------------------
Comment