Hi David,
Thanks for your help. I've taken out the @ character, and added the
error-trapping code to my file.
The results:
When I run the file, nothing untoward is reported, and I end up with a blank
screen in IE / Moxilla Firebird / Opera. There are no errors reported.
In the Apache error log, there are no error or movement messages reported
for this operation.
In the Apache Access Log the following is reported:
"127.0.0.1 - - [12/Dec/2004:13:23:19 +] "GET / HTTP/1.1" 200 1494
127.0.0.1 - - [12/Dec/2004:13:23:20 +] "GET /apache_pb.gif HTTP/1.1"
304 -
127.0.0.1 - - [12/Dec/2004:13:23:32 +] "GET /mysqlconnectcomplete.php
HTTP/1.1" 200 -"
I have the usual permissions on the database server which is accessible via
the command prompt with no problem.
I have the MyODBC driver installed and configured just in case PHP is
looking for it for some strange reason.
I've pasted the code below this message:
Used Code:-
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml";>
Our List of Jokes
Unable to connect to the ' .
'database server at this time.' );
echo mysql_error();
exit();
}
// Select the jokes database
if ([EMAIL PROTECTED]('ijdb')) {
echo mysql_error();
exit('Unable to locate the joke ' .
'database at this time.');
}
?>
Here are all the jokes in our database:
Error performing query: ' . mysql_error() . '');
}
// Display the text of each joke in a paragraph
while ($row = mysql_fetch_array($result)) {
echo '' . $row['joketext'] . '';
}
?>
- Original Message -
From: "David Robley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, December 12, 2004 5:25 AM
Subject: [PHP] Re: Sorry forgot to include the code for my last message -
Mike Francis
> On Sun, 12 Dec 2004 07:03, Mike Francis wrote:
>
> > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> > http://www.w3.org/1999/xhtml";>
> >
> > Our List of Jokes
> > > content="text/html; charset=iso-8859-1" />
> >
> >
> > > // Connect to the database server
> > $dbcnx = @mysql_connect('localhost', 'root', 'MyPassword');
> > if (!$dbcnx) {
> > echo 'Unable to connect to the ' .
> > 'database server at this time.' );
>
> Note that using the @ in front of the connect suppresses any error
messsages
> that may be returned from the connect; I would get rid of that. Then add
> here:
>
> echo mysql_error();
> > exit();
> > }
> > // Select the jokes database
> > if ([EMAIL PROTECTED]('ijdb')) {
>
> And use mysql_error() here too.
> > exit('Unable to locate the joke ' .
> > 'database at this time.');
> > }
> > ?>
>
> mysql_error() will return a useful error message.
>
> --
> David Robley
>
> Backups? We doan *NEED* no steenking baX%^~,VbKx NO CARRIER
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php