Funny errors with IF
| From: | Howard Picken | Date: | Thu, 12 Apr 2001 23:57:53 +0000 |
| Subject: | Funny errors with IF | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-6688@lists.php.net to get a copy of this message | ||
Just starting to learn PHP/MySQL and having problems with "undefined
variable" errors.
All the pages I've created from tutorials give me errors on "some" of the if
statements.
Example 1
<?php
$db = mysql_connect("localhost", "root");
mysql_select_db("mydb",$db);
if ($submit) {
// here if no ID then adding else we're editing
if ($id) {...
where id is the first field of mydb. Using other pages I can see that the
id is there in the mydb file. I also get the same error for "if ($submit..."
Example 2
<?php
$seperator = stripslashes($seperator);
$seperator = stripcslashes($seperator);
if (!$seperator)
$seperator = ",";
if (!$send) {
?>
....etc
I get errors on if (!$sep... etc and on if (!$send... etc
Running Win98SE, Apache 1.3.x, MySQL 3.xx and PHP 4.04
Anyone have any ideas?