Announcements | Last Post | |
---|---|---|
SoC Curricula | 09/30/2017 01:08PM | |
Demarcation or scoping of examinations and assessment | 02/13/2017 07:59AM | |
School of Computing Short Learning Programmes | 11/24/2014 08:37AM | |
Unisa contact information | 07/28/2011 01:28PM |
Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 12:03PM |
Registered: 11 years ago Posts: 45 Rating: 0 |
Re: Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 12:51PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 01:35PM |
Registered: 11 years ago Posts: 45 Rating: 0 |
Re: Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 01:57PM |
Admin Registered: 18 years ago Posts: 10,001 Rating: 353 |
Re: Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 02:15PM |
Admin Registered: 11 years ago Posts: 6,606 Rating: 396 |
You should not try and extract anything from $_POST without checking if it isset.Language: PHP$Submit=$_POST[';Availability';]; //this line gives me an "undefined variable" error...
Language: PHP$Submit=$_POST[';Availability';]; //this line gives me an "undefined variable" error... if(isset($Submit)) // <<< Unnecessary duplication, combine the 2 lines.
Language: PHP$model_id=$_POST[';model';]; $result = $connection->Fetch_model(';model';); // could this section be the troublesome one? <<< Your variable name is $model_id
Language: PHP$model_id=$_POST[';model';]; $colour_id=$_POST[';colour';]; $result = $connection->Avail(';model_id'; , ';colour_id';); // this line? <<< Your variable names are $model_id and $colour_id
Language: PHP$result = $connection->Fetch_colour(';colour';); // or this one? <<< Your variable name is $colour_id
Language: PHP<?php $Submit=$_POST[';Availability';]; //this line gives me an "undefined variable" error... if(isset($Submit)) { $model_id=$_POST[';model';]; $colour_id=$_POST[';colour';]; echo "<br /></br>"; echo "The model "; $result = $connection->Fetch_model(';model';); // could this section be the troublesome one? $result = $connection->Avail(';model_id'; , ';colour_id';); // this line? echo " in the colour "; $result = $connection->Fetch_colour(';colour';); // or this one? } echo "<br /></br>"; $connection->select_db(); ?>
Re: Step 7 - "Model is not available in ANY Colour" - Why?? October 29, 2013 06:01PM |
Registered: 11 years ago Posts: 45 Rating: 0 |
> You should not try and extract anything fromLanguage: PHP> $Submit=$_POST[';Availability';]; //this line gives > me an "undefined variable" error... >
>Language: PHP> $Submit=$_POST[';Availability';]; //this line gives > me an "undefined variable" error... > if(isset($Submit)) > // <<< Unnecessary duplication, > combine the 2 lines. >
>Language: PHP> $model_id=$_POST[';model';]; > $result = $connection->Fetch_model(';model';); // > could this section be the troublesome one? <<< > Your variable name is $model_id >
>Language: PHP> $model_id=$_POST[';model';]; > $colour_id=$_POST[';colour';]; > $result = $connection->Avail(';model_id'; , > ';colour_id';); // this line? <<< Your variable > names are $model_id and $colour_id >
>Language: PHP> $result = $connection->Fetch_colour(';colour';); // > or this one? <<< Your variable name is > $colour_id >
Language: PHP> <?php > $Submit=$_POST[';Availability';]; //this line gives > me an "undefined variable" error... > if(isset($Submit)) > { > $model_id=$_POST[';model';]; > $colour_id=$_POST[';colour';]; > echo "<br /></br>"; > echo "The model "; > $result = $connection->Fetch_model(';model';); // > could this section be the troublesome one? > $result = $connection->Avail(';model_id'; , > ';colour_id';); // this line? > echo " in the colour "; > $result = $connection->Fetch_colour(';colour';); // > or this one? > } > echo "<br /></br>"; > $connection->select_db(); > ?> >