News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

augmentation support

Started by MonkeyMaker, June 30, 2015, 01:59:01 PM

Previous topic - Next topic

MonkeyMaker

I am trying to add a field to a drop down menu in order to retrieve a database entry and place it into a drop down menu. My page won't display and shows this code

Parse error: syntax error, unexpected T_ELSE in /home/content/56/8095656/html/crm/prospects1.php on line 219

but I think the issue is actually in this code


                                        <div class="col-xs-12 col-md-3 col-lg-3">
                                            <div class="form-group">
                                                <div class="col-lg-12 col-sm-12 col-md-12">   
                                                    <label>Lead Generated From</label>
                                                    <select class="form-control" name="lead_from" >
                                                        <option value="Google Search" <?php
                                                       
if ($prospect_details[0]['lead_generated_from'] == 'Google Search') {
                                                           echo
'selected';
                                                       }
                                                       
?>>Google Search</option>
                                                        <option value="Thumbtack" <?php
                                                       
if ($prospect_details[0]['lead_generated_from'] == 'Thumbtack') {
                                                           echo
'selected';
                                                       }
                                                       
?> >Thumbtack</option>
                                                        <option value="Referral" <?php
                                                       
if ($prospect_details[0]['lead_generated_from'] == 'Referral') {
                                                           echo
'selected';
                                                       }
                                                       
?>>Referral</option>
                                                        <option value="Networking" <?php
                                                       
if ($prospect_details[0]['lead_generated_from'] == 'Networking') {
                                                           echo
'selected';
                                                       }
                                                       
?>>Networking</option>
                                                        <option value="Web Leads" <?php
                                                       
if ($prospect_details[0]['lead_generated_from'] == 'Web Leads') {
                                                           echo
'selected';
                                                       }
                                                       
?>>Web Leads</option>
                                                       
                                                        <?php
                                                       $q
= "SELECT lead_type FROM lead_type WHERE user_id='$user_id' LIMIT 10"; //select first ten of users tests
                                                       
$r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc));

                                                       if (
mysqli_affected_rows($dbc) > 0) {//if the query ran correctly and the test details were gathered from the database

                                                       
$row = mysqli_fetch_array($r, MYSQLI_ASSOC);
                                                       
$i = 0;

                                                       while (
$row = mysqli_fetch_array($r, MYSQLI_ASSOC) ) {
                                                           
$lead_type = $row['lead_type'];


                                                           
$q = "SELECT tag_id FROM test_tags WHERE lead_type='$lead_type[$i]"; //select tags corresponding to this test
                                                           
$r2 = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />;
                                                           MySQL Error: "
. mysqli_error($dbc));

                                                           
$i += 1;
                                                           
                                                           
?><option value=<?php echo $lead_type;?>
                                                            if ($prospect_details[0]['lead_generated_from'] == '<?php echo $lead_type?>') {
                                                                echo 'selected';
                                                                ?>><?php echo $lead_type;?></option>
                                                            }

                                                       
                                                        }
                                                   
                                                    </select>
                                                    </option>
                                                    <div>                                                </div>
                                            </div>
                                        </div>
                                    </div> 
                                    <div class="row">
                                        <div class="col-xs-12 col-md-12 col-lg-12">
                                            <div class="form-group">                           
                                                <div class="col-md-12 col-lg-12" style="margin: 10px 0px;">
                                                    <button onclick="window.location.href = 'prospects.php?id=add_new_lead_type'" type="button" style="float:right" class="btn btn-primary newlead"><i class="fa fa-plus">
                                                       
                                                     <button type="submit" name="add_lead" class="btn btn-primary">Add New Lead Type</i></button>
                     
                                            </div>

TehCraw

I'm guessing the problem is not with the code you posted because there is no occurrence of `else` in it. If you could attach the whole file here, we could probably get to the bottom of things faster. :)
Any fool can write code that a computer can understand. Good programmers write code that humans can understand. - Martin Fowler

Advertisement: