very intersting Variable question

by 1 replies
2
Hi... I'm wondering if you can help me create a function which will allow me to insert data into a MySQL table.

The function calls one variable, which then needs to be placed inside other Session variables to be useful. Dig it >>
--------





#programming #intersting #question #variable
  • Banned
    [DELETED]
    • [1] reply
    • Last time I looked, PHP didn't allow anything that complex inside a double-quoted string. If you want it to be automatically parsed and the value included, it can't be any more than a simple variable. So your code would have to look more like this:

      PHP Code:
      $sql "INSERT INTO "$_SESSION[schema_table] .
      "(
      user_id, scratch_id,
      entry_type,
      content_type, content_subtype, content_label,
      urlpath, pagename, section, 
      title, content, content_format,
      collection_array,
      order_pref, status
      )

      VALUES

      (
      '69', '
      $scratch_id', 
      'collection', 'article', '
      $object', '" $_SESSION[new_{$object}_label] . "',
      '" 
      $_SESSION[new_{$object}_urlpath] . "', '" $_SESSION[new_{$object}_label] . "', '$section',
      '" 
      $_SESSION[new_{$object}_title] . "', 'TO BE ADDED', 'plain', 
      '" 
      $_SESSION[brand_new_collection_array] . "',
      'title', 'public'
      )
      "

      I hope this helps.

      Steve

Next Topics on Trending Feed

  • 2

    Hi... I'm wondering if you can help me create a function which will allow me to insert data into a MySQL table. The function calls one variable, which then needs to be placed inside other Session variables to be useful. Dig it >>