user3449257
user3449257

Reputation: 13

Insertion query is not working properly

I have Insertion query its running fine but one variable does not contain any value in the query here is the query

"INSERT INTO `compdb`.`comprepairtbl` (`Userid`, `Name`, `Lname`, 
                                       `Phone`, `Make`, `Model`, 
                                       `ServiceProvider`, `DeviceType`, 
                                       `MEI`, `Condition`, `WinMac`, 
                                       `Charger`, `Problem`, `TotalFee`, 
                                       `PaidFee`, `RemainigFee`, `Call`, 
                                       `SMS`, `Date`, `Status`) 
                               VALUES ('$UID', '$Name', '$Lname', '$Phone ',
                                       '$Make', '$Model', '$ServiceProvider',
                                       '$DeviceType', '$Mei', '$Condition', 
                                       '$WinMac', '$Charger', '$Problem', 
                                       '$TotalFee', '$PaidFee', '$RemaingFee', 
                                       '$Call', '$SMS', '$Date', '$Status')" 

and here is when I echo the query there is noting in $WinMac in the query but I can see if I echo $WinMac above the query

INSERT INTO `compdb`.`comprepairtbl` (`Userid`, `Name`, `Lname`,
                                      `Phone`, `Make`, `Model`, 
                                      `ServiceProvider`, `DeviceType`, 
                                      `MEI`, `Condition`, `WinMac`, 
                                      `Charger`, `Problem`, `TotalFee`, 
                                      `PaidFee`, `RemainigFee`, `Call`, 
                                      `SMS`, `Date`, `Status`) 
                              VALUES ('3', 'bilal', 'ali', '0344 ', 'lumia', 
                                      '920', 'asha', 'black', 'ash', 'Poor', 
                                      '', '', 'prob', '1000', '500', '500', 
                                      'call', 'No', '14-03-23', 'open')

here I can echo $WinMac

 echo $WinMAC = isset($_POST['WinMAC']) ? $_POST['WinMAC'] : '';

here is the HTML code

<select class="input-group-lg" name="WinMAC" id="WinMac"  >
    <option value="Select OS">Select OS</option>
    <option value="Windows">Windows</option>
    <option value="MAC">MAC</option>
</select>

Upvotes: 0

Views: 42

Answers (1)

tjati
tjati

Reputation: 6079

Your first query shows $WinMac but your echo returns $WinMAC. PHP variables are case sensitive. :)

Upvotes: 1

Related Questions