Skip to main content
added 1 characters in body
Source Link
user399666
  • 20k
  • 7
  • 49
  • 68

You were trying to implode an array called field_array, even though your example shows an array called field_arrayfields_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

Edit: You changed your code again. Could you please give us the exact code that you're working with?

You were trying to implode an array called field_array, even though your example shows an array called field_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

Edit: You changed your code again. Could you please give us the exact code that you're working with?

You were trying to implode an array called field_array, even though your example shows an array called fields_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

Edit: You changed your code again. Could you please give us the exact code that you're working with?

added 104 characters in body
Source Link
user399666
  • 20k
  • 7
  • 49
  • 68

You were trying to implode an array called field_array, even though your example shows an array called field_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

Edit: You changed your code again. Could you please give us the exact code that you're working with?

You were trying to implode an array called field_array, even though your example shows an array called field_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

You were trying to implode an array called field_array, even though your example shows an array called field_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());

Edit: You changed your code again. Could you please give us the exact code that you're working with?

Source Link
user399666
  • 20k
  • 7
  • 49
  • 68

You were trying to implode an array called field_array, even though your example shows an array called field_array:

$fields_array = array('course','batch','branch');
$fields = implode(", ",$fields_array);
$resource = mysql_query("SELECT $fields FROM some_table") or die(mysql_error());