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); |