ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Comma Separated Value Data Problem

October 30, 2012 10:38pm

Subscribe [2]
  • #1 / Oct 30, 2012 10:38pm

    kalspaugh

    3 posts

    I am pulling data from the exp_channel_data table.  One of the fields contains name data in the format <lastname, firstname>.  I need to use this data in a php segment.  When I try to use this data it throws errors that I am passing two values to a function that only expects one value or “Use of undefined constant <lastname>”.  It is treating the single value as two comma separated values. I don’t understand why this is happening.  The value pulled from the db should be treated as a string…not two strings.

    How can I avoid this?

    I’m using ExpressionEngine v2.5.2 - Build Date: 20120606

    Thanks,

    Kevin

  • #2 / Nov 01, 2012 11:34am

    Shane Eckert

    7174 posts

    Hello Kevin,

    Thank you for posting your question.

    How are you pulling this data? Is this using a channel entries tag?

    Is this a custom script you wrote?

    Please let me know.

    Thank you,

  • #3 / Nov 01, 2012 12:49pm

    kalspaugh

    3 posts

    Hi Shane,

    I figured out what I was doing wrong.  I am pulling the data using the Query module.  When I was storing the name value to a php variable I forgot to wrap it in quotes.

    I was doing this $p_name = {field_id_4}

    when I should have been doing this $p_name = ‘{field_id_4}’;

    Thanks,

    Kevin

  • #4 / Nov 02, 2012 3:18pm

    Shane Eckert

    7174 posts

    Hey there kalspaugh,

    Awesome! Nice work getting it figured out!

    If you need anything else, please just let me know by opening a new thread.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases