Helping ordinary people create extraordinary websites!

Go Back   Web Development Forum > Website Designing > HTML/CSS
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-10-2009, 05:45 AM
Junior Member
 
Join Date: Jun 2009
Posts: 2
Default very intersting Variable question

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



function new_sql($object) {

$scratch_id = get_scratch();
$section = $object . "s";

$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'
)
";

mysql_query($sql) or die(mysql_error());

} // end function




I'm getting a parse error, for what should be obvious reasons... but do you get the gist of where I need to go with this?

An $object = "issue" or $object = "article" something like that...
__________________
Angioplasty
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

All times are GMT -5. The time now is 10:46 AM.


Website Design by Ducani Media Group
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.