HighDots Forums  

PHP script problem

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss PHP script problem in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
rG]Courage-D-
 
Posts: n/a

Default PHP script problem - 01-01-2005 , 04:52 PM






i have a problem with the part of my script:
mysql_select_db($database_localhost, $localhost); $CharakterName =
GetSQLValueString($_POST['CharakterName'], 'tekst'); $query_phpbb_posts =
'SELECT * FROM phpbb_posts WHERE temp = $CharakterName'; (the whole script is
add below) i get the error 'Unknown column '(CharakterName here, depends of
what you enterd in the form)' in 'where clause''

FIRST I INSERT DATA INTO "TEMP"
//insert into phpbb_posts
$insertSQL = sprintf("INSERT INTO phpbb_posts (forum_id, poster_id,
post_username, enable_bbcode , enable_html, enable_smilies, enable_sig,
post_edit_count, temp) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['forum_id'], "text"),
GetSQLValueString($_POST['poster_id'], "text"),
GetSQLValueString($_POST['post_username'], "text"),
GetSQLValueString($_POST['enable_bbcode'], "text"),
GetSQLValueString($_POST['enable_html'], "text"),
GetSQLValueString($_POST['enable_smilies'], "text"),
GetSQLValueString($_POST['enable_sig'], "text"),
GetSQLValueString($_POST['post_edit_count'], "text"),
GetSQLValueString($_POST['CharakterName'], "text"));
mysql_select_db($database_localhost, $localhost);
$Result1 = mysql_query($insertSQL, $localhost) or die(mysql_error());

//insert into phpbb_topics
//phpbb_posts//

THEN I WANT TO GET INFOMATION OUT OF TEMP

mysql_select_db($database_localhost, $localhost);
$CharakterName = GetSQLValueString($_POST['CharakterName'], "tekst");
$query_phpbb_posts = "SELECT * FROM phpbb_posts WHERE temp = $CharakterName";
$phpbb_posts = mysql_query($query_phpbb_posts, $localhost) or
die(mysql_error());
$row_phpbb_posts = mysql_fetch_assoc($phpbb_posts);
$totalRows_phpbb_posts = mysql_num_rows($phpbb_posts);


Reply With Quote
  #2  
Old   
Tom Muck
 
Posts: n/a

Default Re: PHP script problem - 01-01-2005 , 06:09 PM







"rG]Courage-D-" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
i have a problem with the part of my script:
mysql_select_db($database_localhost, $localhost); $CharakterName =
GetSQLValueString($_POST['CharakterName'], 'tekst'); $query_phpbb_posts =
'SELECT * FROM phpbb_posts WHERE temp = $CharakterName'; (the whole
script is
add below) i get the error 'Unknown column '(CharakterName here, depends
of
what you enterd in the form)' in 'where clause''
You need single quotes around your variable, and double quotes around the
whole string:

"SELECT * FROM phpbb_posts WHERE temp = '$CharakterName'";


--
-------------------------------------------
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Extending Knowledge, Daily
http://www.CommunityMX.com/




Reply With Quote
Reply




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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.