| | |
php mysql help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2005
Posts: 12
Reputation:
Solved Threads: 0
hi im new to php/mysql i have developed a code in asp and converted it to php with asp2php programme. the original solution asp/sqlserver iis works fine..the new solution will be a iis php mysql. mysql server works fine iis works fine however the php wont let me connect to the mysql database i have created..when i connect with asp it does! there must be something missing in the code. i tried all kinds of config
so this is whats happening when i try to connect with php the page returns on itself as if the username and password submitted in the form is wrong or not found. yet when i connect to the same database with asp it goes correctly. when i alter the connection strings (php) i get the error
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
therefore i go back to my original script which is as follows
[php]//check that user exists and login is correct
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
@mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
$RSStudent=$RSStudent_query=@mysql_query(("SELECT StudentID FROM MMStudents where StudentEmailAddress = '"
.$_POST["EmailAddress"]."' and StudentPassword = '"
.$_POST["Password"]."'"),$conn);
$RSStudent=@mysql_fetch_array($RSStudent_query);
if (($RSStudent==0))
{
//invalid login
$TheMessage="Student not found. Re enter the correct email and password.";
}
else
{
//valid entry[/php]
as you can see the user is sent back to the logging page when the username and password is not verified against the database...
im sure there is something missing in the code that is preventing it from connecting to the database to retrieve the details..as i say im completely new to php and cant see what is wrong here..
any help would be great!
thanks in advance chris
so this is whats happening when i try to connect with php the page returns on itself as if the username and password submitted in the form is wrong or not found. yet when i connect to the same database with asp it goes correctly. when i alter the connection strings (php) i get the error
#1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL client
therefore i go back to my original script which is as follows
[php]//check that user exists and login is correct
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
@mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
$RSStudent=$RSStudent_query=@mysql_query(("SELECT StudentID FROM MMStudents where StudentEmailAddress = '"
.$_POST["EmailAddress"]."' and StudentPassword = '"
.$_POST["Password"]."'"),$conn);
$RSStudent=@mysql_fetch_array($RSStudent_query);
if (($RSStudent==0))
{
//invalid login
$TheMessage="Student not found. Re enter the correct email and password.";
}
else
{
//valid entry[/php]
as you can see the user is sent back to the logging page when the username and password is not verified against the database...
im sure there is something missing in the code that is preventing it from connecting to the database to retrieve the details..as i say im completely new to php and cant see what is wrong here..
any help would be great!
thanks in advance chris
After mysql_connect(), put this:
[php]if (!$conn) {
die('Not connected : ' . mysql_error());
}[/php]
[php]if (!$conn) {
die('Not connected : ' . mysql_error());
}[/php]
What version of mysql?? If it is new and php is not new, you might try starting the mysql server with the option --old-passwords. If you use mysqladministrator (gui) you can choose the old passwords option under the security tab.
You can read about it in detail here:
A.2.3. Client does not support authentication protocol
Dance
You can read about it in detail here:
A.2.3. Client does not support authentication protocol
Dance
•
•
Join Date: Mar 2005
Posts: 12
Reputation:
Solved Threads: 0
hi the version of mysql is mysql client version 5.0.0 and the php version is 5. im using windows 2003 and iis 6. My previous error was that the page returned on itself stating that the user was not found. the database, iis odbc are all in place and work fine with ASP. however the php wont let me logg in.
to try and fix this i upgraded the php to 5 and i now get a blank white page returned when i try to logg into the site. the code im using to connect is:
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
the server name user database name and password are all correct
as im new to mysql +php im not sure if its a code error or a mysql/php version incompatability issue
when i alter the code i get different error messages or as in the latest case i get returned a blank white page with no error message
for example if i remove the "@" in the line
$conn=@mysql_connect("localhost","root","astra123");
i get the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
line 22 in my code is highlighted in bold above
i figure the "@" is a way to prevent ugly error messages presenting on the page
its all very frustrating any help appreciated and thanks in advance
cheers
chris
to try and fix this i upgraded the php to 5 and i now get a blank white page returned when i try to logg into the site. the code im using to connect is:
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
the server name user database name and password are all correct
as im new to mysql +php im not sure if its a code error or a mysql/php version incompatability issue
when i alter the code i get different error messages or as in the latest case i get returned a blank white page with no error message
for example if i remove the "@" in the line
$conn=@mysql_connect("localhost","root","astra123");
i get the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
line 22 in my code is highlighted in bold above
i figure the "@" is a way to prevent ugly error messages presenting on the page
its all very frustrating any help appreciated and thanks in advance
cheers
chris
•
•
Join Date: Mar 2005
Posts: 12
Reputation:
Solved Threads: 0
firstly apologies for the double submission
hi the version of mysql is mysql client version 5.0.0(4.1.10nt-via TCP/IP) and the php version is 5.0.3. im using windows 2003 and iis 6. My previous error was that the page returned on itself stating that the user was not found. the database, iis odbc are all in place and work fine with ASP. however the php wont let me logg in.
to try and fix this i upgraded the php to 5 and i now get a blank white page returned when i try to logg into the site. the code im using to connect is:
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
the server name user database name and password are all correct
as im new to mysql +php im not sure if its a code error or a mysql/php version incompatability issue
when i alter the code i get different error messages or as in the latest case i get returned a blank white page with no error message
for example if i remove the "@" in the line
$conn=@mysql_connect("localhost","root","astra123");
i get the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
line 22 in my code is highlighted in bold above
i figure the "@" is a way to prevent ugly error messages presenting on the page
its all very frustrating any help appreciated and thanks in advance
cheers
chris btw i have reset the old password in mysqladministrator and reset it to old password from a dos prompt. i tried those options( which didnt work) before i upgraded to php 5
hi the version of mysql is mysql client version 5.0.0(4.1.10nt-via TCP/IP) and the php version is 5.0.3. im using windows 2003 and iis 6. My previous error was that the page returned on itself stating that the user was not found. the database, iis odbc are all in place and work fine with ASP. however the php wont let me logg in.
to try and fix this i upgraded the php to 5 and i now get a blank white page returned when i try to logg into the site. the code im using to connect is:
// $conn is of type "adodb.connection"
$conn=@mysql_connect("localhost","root","astra123");
mysql_select_db("mildmaydemo",$conn);
//root", "astra123"
the server name user database name and password are all correct
as im new to mysql +php im not sure if its a code error or a mysql/php version incompatability issue
when i alter the code i get different error messages or as in the latest case i get returned a blank white page with no error message
for example if i remove the "@" in the line
$conn=@mysql_connect("localhost","root","astra123");
i get the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
line 22 in my code is highlighted in bold above
i figure the "@" is a way to prevent ugly error messages presenting on the page
its all very frustrating any help appreciated and thanks in advance
cheers
chris btw i have reset the old password in mysqladministrator and reset it to old password from a dos prompt. i tried those options( which didnt work) before i upgraded to php 5
Last edited by androstendione; Mar 2nd, 2005 at 7:05 am. Reason: MISTAKE
•
•
Join Date: Mar 2005
Posts: 12
Reputation:
Solved Threads: 0
i installed from zip and copied libmysql.dll and php5ts.dll to win/system 32. my php.info page works ok i was reccomended to configure my php.ini file to recognise mysql ie
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
yet still my login php page gives the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
and my phpmyadmin page gives the error
cannot load mysql extension,
please check PHP Configuration
i am sure the problem is that php 5 cannot recognise ,mysql server, or that in php 5 mysql server recognition isnt built in as default...one thing is for sure it should work fine but it isnt connecting to the mysql databse..before i upgraded i was getting the error message user not found...even though all the connection details were correct..this re itterates my point...php either cant connect or cant recognise mysql for some reason...any help would be appreciated
cheers
chris
;extension=php_msql.dll
extension=php_mysql.dll
;extension=php_oci8.dll
yet still my login php page gives the error
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\mildmayphp\index.php on line 22
and my phpmyadmin page gives the error
cannot load mysql extension,
please check PHP Configuration
i am sure the problem is that php 5 cannot recognise ,mysql server, or that in php 5 mysql server recognition isnt built in as default...one thing is for sure it should work fine but it isnt connecting to the mysql databse..before i upgraded i was getting the error message user not found...even though all the connection details were correct..this re itterates my point...php either cant connect or cant recognise mysql for some reason...any help would be appreciated
cheers
chris
Is libmysql.dll in your c:\windows directory?
•
•
•
•
Note: Windows users will need to enable php_mysql.dll inside of php.ini and either copy libmysql.dll into the Windows system directory, or make it available to the PATH. from: http://us4.php.net/mysql
•
•
Join Date: Mar 2005
Posts: 12
Reputation:
Solved Threads: 0
yes i have enable php mysql in php.ini
also libmysql.dll is located in c:\windows
this is the error from the index.php (phpmyadmin)
cannot load mysql extension,
please check PHP Configuration
Documentation
aside from pulling hair out do i need to unninstall everything i can find on the system to do with php in order to install an earlier version of php? what version of php works best with mysql ? and which version of php works best with which version of mysql?
v frustrating
thanks in advance
ive tried all sorts of things to get this to work
seasrched 100s of sites and forums
maybe a complete re install is required with a compatable php/mysql config
rather than on a php version that requires a manual re config of all the guts
thanks in advance
chris
also libmysql.dll is located in c:\windows
this is the error from the index.php (phpmyadmin)
cannot load mysql extension,
please check PHP Configuration
Documentation
aside from pulling hair out do i need to unninstall everything i can find on the system to do with php in order to install an earlier version of php? what version of php works best with mysql ? and which version of php works best with which version of mysql?
v frustrating
thanks in advance
ive tried all sorts of things to get this to work
seasrched 100s of sites and forums
maybe a complete re install is required with a compatable php/mysql config
rather than on a php version that requires a manual re config of all the guts
thanks in advance
chris
![]() |
Similar Threads
- Looking for PHP / MySQL Developer (Web Development Job Offers)
- Looking for a PHP/MYSQL Programmer (Web Development Job Offers)
- Need Highly Experienced PHP/MySQL Programmer $15-$25/hour (Web Development Job Offers)
- PHP/MySQL Programmer Position (Web Development Job Offers)
Other Threads in the PHP Forum
- Previous Thread: USB device command
- Next Thread: Creating linked pages
| Thread Tools | Search this Thread |
# address apache api array autoincrement beginner binary broken cakephp checkbox class clean cms code countingeverycharactersfromastring crack cron curl database date decode dehasher directory display dissertation dynamic echo email error fairness file files folder form forms function functions google href htaccess html image include incode insert ip javascript joomla legislation limit link login mail masterthesis match menu method mlm multiple mysql newsletters oop pagerank paypal pdf persist php play protocol query question radio random remote root script search server sessions simple sms soap source space spam sql support! syntax system table tutorial update upload url validator variable video web youtube





