Jump to content

SQL Query


hewstone999

Recommended Posts

Hey guys,

 

I have the code below which inputs data in a database, however instead of inputted the values i want, it inputs the string: Is there someting wrong with $RowName?

 

$ColName = "Col1,Col2,Col3";

$RowName = "'$line[0]','$line[1]','$line[2]'";

 

$data = file_get_contents($table);

$rows = explode("\n", $data);   

foreach($rows as $row){

  $line = explode(',', $row);

$SQLCODE = "INSERT INTO TempData($ColName) VALUES($RowName)";

$rS = $db_conn->execute($SQLCODE);

 

  } 

Link to comment
https://forums.phpfreaks.com/topic/142853-sql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.