Re: Funny errors with IF
| From: | John Lim | Date: | Fri, 13 Apr 2001 10:04:29 +0000 |
| Subject: | Re: Funny errors with IF | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-6706@lists.php.net to get a copy of this message | ||
Before you can use any variable, you need to set it to value first. I don't
know where you got these examples from, but I believe the authors presume
that you have initialised the variables somewhere else.
If you are learning php, i suggest you use simpler examples, as these
examples probably assume advanced knowledge. I like the tutorials at
http://devshed.com/ myself.
""Howard Picken"" <hpicken@our.net.au> wrote in message
news:9b5f1s$9j3$1@toye.p.sourceforge.net...
> 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?
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
> For additional commands, e-mail: php-windows-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>