Customer Review

1.0 out of 5 stars One star is too many: don't buy this book., Aug. 28 2003
This review is from: PHP and PostgreSQL Advanced Web Programming (Paperback)
It's hard to argue than any book has absolutely zero value: even the world's worst book (and this one may be in the running) probably contains some useful information. However, in a worthwhile book, I expect to find a good deal of useful information, and more than that, I expect not to find false information. There are enough errors in the first 60 pages of this book that I am not going to bother reading the rest of it.
Example: p. 50 shows this code segment
<?php
$a=23;
$b=34;
if ($a > $b)
{
echo 'a is higher than b';
}
else
{
echo 'b is higher than a';
}
?>
The merest child, although evidently not SAMS technical editors, can see the elementary error here, which occurs when $a = $b.
Example: p. 53 shows this code segment
<?php
$a=18;
$b=19;
if ($a xor $b)
{
echo '$a and $b are the same';
}
else
{
echo '$a and $b are not the same';
}
?>
with the comment that the code will return "$a and $b are not the same".
If the author's earlier comment, that "False is returned if both values are the same", is correct, then this is obviously backwards, but beyond that, what is the basis of the comparison? In other languages I'm familiar with, XOR compares two Boolean values, or possibly performs a bitwise comparison on byte values. Are the authors telling us that in PHP XOR performs the same function as the inequality operator? Or is it that in PHP even numbers are True and odd numbers are False? Or what?
The most likely explanation is that this example is simply garbage, and I strongly suspect that the rest of the book, which I no longer intend to read, is the same. I don't know much about PHP, which is why I bought the book, but I know enough about other programming languages to know that I can't have any faith in what this book tells me.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


Review Details

Item

3.8 out of 5 stars (12 customer reviews)
5 star:
 (6)
4 star:
 (2)
3 star:
 (1)
2 star:
 (1)
1 star:
 (2)
 
 
 
Used & New from: CDN$ 6.94
Add to wishlist
Reviewer


Location: Shawnigan Lake, BC

Top Reviewer Ranking: 455,950