On Mon, 05 Dec 2005 20:48:28 +0000, Aggro wrote:[color=blue][color=green]
>> No errors are generated.[/color]
>[color=green]
>> $conn=@mysql_connect( "localhost", "root", "admin" );
>> echo("<br>Connected to the database!");[/color]
>
> Your problem is that you don't know php.[/color]
Inflamatory considering that you seem to have misunderstood his point...
[color=blue]
> If mysql_connect() fails, your
> program won't print any errors and it won't stop there. The @-characters
> in front of a function disables printing of any internal error messages
> and since you don't even thech the result of $conn, you won't get any
> information if the function fails or doesn't fail.[/color]
I think you're missing the OPs point. The code (better formatted as you
typed it above) should try to connect to the database (without printing
errors or stopping). Then it should print a line of text (regardless of
connection or not).
The OP is saying it never gets that far! It only prints the first line,
which means the script is stopping on the mysql_connect line, not just
failing to connect.
To be honest, I'd say that for some reason it's not recognising the MySQL
extension and if you remove the @ symbol you'll get a fatal error saying:
"undefined function mysql_connect"
The script is therefore stopping at that point but your @ is supressing
the printing of the message.
But that's just a best guess, I've never had PHP not recognise the MySQL
extension, but then again I've never installed it on Windows...
Cheers,
Andy
--
Andy Jeffries | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos