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"" <[EMAIL PROTECTED]> wrote in message
9b5f1s$9j3$[EMAIL PROTECTED]">news:9b5f1s$9j3$[EMAIL PROTECTED]...
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to