View Single Post
Old 16.06.2006, 20:01   #24
Bruenor
Архивный участник
 
Join Date: Jun 2006
Posts: 14
Default

All of the corrections that I posted were fixes to error messages that I got.


Quote:
Originally Posted by hel
"$dbname" not interpretted as variable. (only if I set it like " ".$dbname." ")
This confuses me. The dollar sign forces php to treat the word following it as a variable, so I don't understand how it's being interpreted as text for you.


Quote:
Originally Posted by hel
I don't understand, what you mean about moving include('config.php');.
I was just talking about things I tried doing so that only one "include ('config.php');" would have to appear in the file. The text within the parentheses there wasn't very important.


Quote:
Originally Posted by hel
You mean, I must set default values for variables?
That is correct. It's the reason for most of the corrections that I posted. I'm not sure if the php interpreter you use automatically initializes variables to 0 or "", but mine doesn't, and I'm sure it's the same for other people.


Quote:
Originally Posted by hel
For what? Is this a checking for empty results?
I was getting an error message each time php came across a $skill_book_id[$sid] that wasn't initialized. Checking to see if has been initialized prevents the error message. (Operators in php use short-circuit evaluation. If isset($skill_book_id[$sid]) is false, then $skill_book_id[$sid]==$sid never gets evaluated.)


Quote:
Originally Posted by hel
I think better is setting up 2001,-1. For infinite.
That doesn't work for me. The php interpreter I use does not treat -1 as infinite, so it gives an error message because the second number is smaller than the first.


Maybe the problem is just that I'm using an old version of php, but it's better to program things for the greatest compatibility. :wink:
Bruenor is offline