Fark_Maniac
2[H]4U
- Joined
- Feb 21, 2002
- Messages
- 2,438
I'm just starting out with mysql and PHP. I've bought books to step me through things and I've had c++ up through data structures, so I'm pretty confident in my php coding.
I'm running into problems with my MySQL server. I've installed it on my home workstation, which is behind a router...but I don't think that's my problem as I've opened up port 3306. I've gotten EngInSite mysql client to interact with the server as 'root' and as 'dataop' (user I wish to interact with mysql via php), but only on localhost. I have an offsite server that I've installed the client on to and 'root' may login, given the correct IP, but all other users throw an error: "Access denied".
when I try to have my php code connect at to the mysql server, anything after the mysql_connect() function is simply not parsed...like it was never there.
This is my code:
This is what I get:
I had echo's after the connect, but it never happens.
So with my attempts with the client logons and the webpage parsing, I can only assume that my server is denying the specified user access...but I don't know where to look.
Any suggestions would be greatly appreciated, whether web pages or setting suggestions. Believe me...I've googled!
EDIT: I've changed the proposed code to reflect the current file being tested and fixed typos. the file in question has my IP specified and does not use "localhost"
I'm running into problems with my MySQL server. I've installed it on my home workstation, which is behind a router...but I don't think that's my problem as I've opened up port 3306. I've gotten EngInSite mysql client to interact with the server as 'root' and as 'dataop' (user I wish to interact with mysql via php), but only on localhost. I have an offsite server that I've installed the client on to and 'root' may login, given the correct IP, but all other users throw an error: "Access denied".
when I try to have my php code connect at to the mysql server, anything after the mysql_connect() function is simply not parsed...like it was never there.
This is my code:
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
$string = "Fugly <br>";
$user = "dataop";
$pass = "forumedited";
echo "Dude, where's my car?<br>";
echo $string;
$conn = mysql_connect("localhost",$user,$pass);
echo "Hey, it works";
?>
</body>
</html>
Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Dude, where's my car?<br>Fugly <br>
So with my attempts with the client logons and the webpage parsing, I can only assume that my server is denying the specified user access...but I don't know where to look.
Any suggestions would be greatly appreciated, whether web pages or setting suggestions. Believe me...I've googled!
EDIT: I've changed the proposed code to reflect the current file being tested and fixed typos. the file in question has my IP specified and does not use "localhost"