Something's confusing me... I have this piece of code:
... which works fine.
$stmt = $dbh->prepare($query);
$result = $stmt->execute('Joe');
Then I figured I could shorten it a bit by doing this:
... which gives me a parse error:
$result = $dbh->prepare($query)->execute('Joe');
I have seen this being done in the book "Advanced PHP Programming", but all the code in there is written for PHP5. Is what I'm trying to above not possible in PHP4?
parse error, unexpected T_OBJECT_OPERATOR in [...] on line 9
I'm sorry to have to ask about basic PHP syntax, but I could not find this in the manual, partly because I find it hard to put this into words.