I have been having problems connecting php with mysql and was advised to remove the @ from the following code below;
// Connect to the database server
$dbcnx = mysql_connect('localhost', 'root',
'mypasswd');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
} else {
echo '<p>Database connection established.</p>';
}
I have removed the @ on the code on my php script(work.php) and this is the error message i received;
Fatal error: Call to undefined function mysql_connect() in C:\Inetpub\wwwroot\work.php on line 10
So what next??
remember here is the code;
// Connect to the database server
$dbcnx = mysql_connect('localhost', 'root',
'mypasswd');
if (!$dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
} else {
echo '<p>Database connection established.</p>';
}
...Can i connect from my mysql command line client and produce the desired output i need...?
if not how do i correct the error statement shown above??
If it's the command line prompt on mysql,i have installed it successfully on my windows platform..how can i connect mysql with php from the command line prompt and have a confirmation that the connection has been established ??is that possible
if not how do i correct the error statement shown above??