Hey,
I'm new to php/MySQL and am currently working through a php/MySQL tutorial/book... I'm getting along well with it, but one thing that is bugging me is part of the syntax the book tells me to add in, yet has not explained it at all!.. So I was thinking maybe its something really insignificant, but for when I'm writing my own scripts from scratch I would really like to understand WHY I'm including each part, and the necessity for it etc..
So anyways what I want to know is what the ' . ' means.?
For example:
So in the above connection to the MySQL server I'm adding a custom error message, BUT what and why has the tutorial/book told me to add ' . after 'connect to the' .. then ' before the 'database server at...' etc.
If anyone could clear this up, it would be great!.. as I have no idea as to why its used, and what it does etc.. I've also used it when inserting php functions within an error message, such as..
Any help on clearing this question up, would be great!
Thanks,
I'm new to php/MySQL and am currently working through a php/MySQL tutorial/book... I'm getting along well with it, but one thing that is bugging me is part of the syntax the book tells me to add in, yet has not explained it at all!.. So I was thinking maybe its something really insignificant, but for when I'm writing my own scripts from scratch I would really like to understand WHY I'm including each part, and the necessity for it etc..
So anyways what I want to know is what the ' . ' means.?
For example:
PHP:
$dbcnx = @mysql_connect('localhost', 'root', 'mypassword');
if (!dbcnx) {
exit('<p>Unable to connect to the ' .
'database server at this time.</p>');
}
So in the above connection to the MySQL server I'm adding a custom error message, BUT what and why has the tutorial/book told me to add ' . after 'connect to the' .. then ' before the 'database server at...' etc.
If anyone could clear this up, it would be great!.. as I have no idea as to why its used, and what it does etc.. I've also used it when inserting php functions within an error message, such as..
PHP:
Error: ' . mysql_error() . '
Any help on clearing this question up, would be great!
Thanks,
