PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
?php session_start(); ?> Ok, we are about to start: 07-18-2004 12:06 PM.
Fatal error: Call to undefined function: mysql_connect() in /var/www/Esgames4uweb/validate.php on line 19
I have to ask you guys about every error because im not very experienced with php
That's really weird. If the mysql extensionis enabled in your php.ini then you shouldn't be getting the error you got. I will have to think about this one for a bit.
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
THis is what my current code im trying to get to work looks like:
<?php
session_start();
?>
<html>
<head>
<title>validate.php</title>
</head>
<body>
Ok, we are about to start: <?php echo date("m-d-Y g:i A"); ?>.
<?php
if (isset($_POST))
{
$user_name = $_POST['user_name'];
$password = $_POST['password'];
$db_user = 'mysql_username';
$db_pass = 'mysql_password';
//connect to the DB and select the "dictator" database
$connection = mysql_connect('localhost', $db_user, $db_pass) or
die(mysql_error());
mysql_select_db('Esgames4ulogin') or die(mysql_error());
//set up the query
$query = "SELECT * FROM users
WHERE user_name='$user_name' AND password='$password'";
// Test output of something
echo $query . "<br />\n";
//run the query and get the number of affected rows
$result = mysql_query($query, $connection) or die('error making
query: ' .mysql_error());
echo mysql_num_rows($result);
}
else
{
echo 'There was nothing posted...';
}
?>
OK, finishing up: <?php echo date("m-d-Y g:i A"); ?>.
</body>
</html>
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
;
; If you wish to have an extension loaded automatically, use the following
; syntax:
;
; extension=modulename.extension
;
; For example, on Windows:
;
; extension=msql.dll
;
; ... or under UNIX:
;
; extension=msql.so
;
; Note that it should be the name of the module only; no directory information
; needs to go here. Specify the location of the extension with the
; extension_dir directive above.
;
; Load the MySQL module by default. Comment this out if you don't use MySQL.
extension=mysql.so
; Load the gettext extension by default. Comment this out if you don't have the
; gettext shared library installed.
extension=gettext.so
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;;extension=php_mbstring.dll
;extension=php_mbstring.dll
;extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_crack.dll
;extension=php_curl.dll
;extension=php_db.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_domxml.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_hyperwave.dll
;extension=php_iconv.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_oci8.dll
;extension=php_openssl.dll
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_printer.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xslt.dll
;extension=php_yaz.dll
;extension=php_zip.dll
Heres some more info that show my extensions and that i dont have the extension=php_mysql