Help me im only a novice

Security issues related to php and mysql usage. How to make your code secure? Security measures and configurations? It's all in here!

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 6
Joined: Tue Jul 26, 2005 7:05 pm

Tue Jul 26, 2005 7:09 pm

Hello im using apache php5 and mysql4.1..
i am just trying to connect to the database with a password and username..but an error occuer

Fatal error: Call to undefined function mysql_connect() in c:\webs\test\connect.php5 on line 5

Please help me

Here is my code

Code: Select all

<head><title>Connect Server</title></head>
$link = mysql_connect("localhost",$_POST['username'],$_POST['password'])or die("Connect 

Eror: ".mysql_error());
print "Successfully connected.\n";
User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2213
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län

Wed Jul 27, 2005 2:54 am

in your php.ini file find extentions section.

find extention=php_mysql.dll and uncomment it
if it doesnt exists: find extention=php_mysqli.dll and copy that line, then paste it before/after the original line and uncomment it, and remove i from one of the lines.. this will assure you have the correct syntax and also make sure that you are loading the mysql extention... then restart your server..
Best Regards,
Alexej Kubarev
Zend Certified Engineer
Image Image
Post Reply