Current location: Hot Scripts Forums » Programming Languages » PHP » Update Function Error


Update Function Error

Closed Thread
  #1 (permalink)  
Old 11-03-06, 08:39 AM
tommyc325's Avatar
tommyc325 tommyc325 is offline
Wannabe Coder
 
Join Date: Sep 2005
Posts: 223
Thanks: 0
Thanked 0 Times in 0 Posts
Update Function Error

PHP Code:

function editform() {


 global 
$database_blog_oconn$blog_oconn$session_id
 
 if (!
function_exists("GetSQLValueString")) {
function 
GetSQLValueString($theValue$theType$theDefinedValue ""$theNotDefinedValue ""
{
  
$theValue get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  
$theValue function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch (
$theType) {
    case 
"text":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;    
    case 
"long":
    case 
"int":
      
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case 
"double":
      
$theValue = ($theValue != "") ? "'" doubleval($theValue) . "'" "NULL";
      break;
    case 
"date":
      
$theValue = ($theValue != "") ? "'" $theValue "'" "NULL";
      break;
    case 
"defined":
      
$theValue = ($theValue != "") ? $theDefinedValue $theNotDefinedValue;
      break;
  }
  return 
$theValue;
}
}

$editFormAction $_SERVER['PHP_SELF'];
if (isset(
$_SERVER['QUERY_STRING'])) {
  
$editFormAction .= "?" htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset(
$_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  
$insertSQL sprintf("INSERT INTO comments (`comment`, entrie, `user`, `date`) VALUES (%s, %s, %s, %s)",
                       
GetSQLValueString($_POST['comment'], "text"),
                       
GetSQLValueString($_POST['session_id'], "text"),
                       
GetSQLValueString($_POST['user'], "text"),
                       
GetSQLValueString($_POST['date'], "text"));

  
mysql_select_db($database_blog_oconn$blog_oconn);
  
$Result1 mysql_query($insertSQL$blog_oconn) or die(mysql_error());

  
$insertGoTo "entrie_detail.php?session_id=$session_id";
  if (isset(
$_SERVER['QUERY_STRING'])) {
    
$insertGoTo .= (strpos($insertGoTo'?')) ? "&" "?";
    
$insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  
header(sprintf("Location: %s"$insertGoTo));
}

$colname_subscribers "-1";
if (isset(
$_SESSION['MM_Username'])) {
  
$colname_subscribers = (get_magic_quotes_gpc()) ? $_SESSION['MM_Username'] : addslashes($_SESSION['MM_Username']);
}

Description: im passing the session_id and the email from a form from the previous page.... i already echoed them out and they return no problems... im basically trying to update the record thats === to my session_id

also i`m not recieving any errors.

RESULT: it runs through the script but doesnt update the certain record.

any suggestions.
  #2 (permalink)  
Old 11-03-06, 08:49 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
Please do not create more than one topic for each problem.

http://www.programmingtalk.com/showthread.php?t=33827

You're allowed to bump it every 24 hours.


Closed.
Closed Thread

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Update Function Error tommyc325 PHP 2 11-02-06 03:49 PM
Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' Dr. Forensics PHP 3 07-15-06 03:54 PM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
PHP Error Fairnie PHP 8 06-26-04 07:15 AM
Help trim code down TheLaughingBandit JavaScript 0 09-02-03 09:50 AM


All times are GMT -5. The time now is 05:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.