• Mikiko Anhoco
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Lets say, i want to import/upload excel file to mysql from PHP
My HTML is like below

<form enctype="multipart/form-data" method="post" role="form"> <div class="form-group"> <label for="exampleInputFile">File Upload</label> <input type="file" name="file" id="file" size="150"> <p class="help-block">Only Excel/CSV File Import.</p> </div> <button type="submit" class="btn btn-default" name="Import" value="Import">Upload</button> </form>
PHP code is like below
<?php if(isset($_POST["Import"])) { //First we need to make a connection with the database $host='localhost'; // Host Name. $db_user= 'root'; //User Name $db_password= ''; $db= 'product_record'; // Database Name. $conn=mysql_connect($host,$db_user,$db_password) or die (mysql_error()); mysql_select_db($db) or die (mysql_error()); echo $filename=$_FILES["file"]["tmp_name"]; if($_FILES["file"]["size"] > 0) { $file = fopen($filename, "r"); //$sql_data = "SELECT * FROM prod_list_1 "; while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE) { //print_r($emapData); //exit(); $sql = "INSERT into prod_list_1(p_bench,p_name,p_price,p_reason) values ('$emapData[0]','$emapData[1]','$emapData[2]','$emapData[3]')"; mysql_query($sql); } fclose($file); echo 'CSV File has been successfully Imported'; header('Location: index.php'); } else echo 'Invalid File:Please Upload CSV File'; } ?>


I want to import only the 2nd row values into my table. Please help me how can i solve it or give me any resource. I was able to upload the excel file but it is not correctly formatted. i want to upload 4 column in mysql's 4 column but it is uploading all 4 column in mysql's 1 column. am i missing something ?
Hello All,

It is a specific requirements from my client's IT services NOT to use Apex unless it is absolutly impossible to do otherwise. Here is my need, 
I created a lightning component to update a specific field on the Case object, the user was supposed to choose a rating from radio buttons and an Apex controller modified a custom field with the selected value.

That was before I knew that they were stricly "apexless". So the question is, is there a way to update a field directly within a lightning component without using any Apex ?

I've read about Lightning Data Service, but I'm not quite sure yet that it is what I want to do as it updates the whole object and not just the field I want to modify. 

Any inputs on that ? Thank you !