www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > Dreamweaver/Expression Web

    Dreamweaver/Expression Web or any other WYSIWYG page making software such as GoLive, ImageReady, etc. Discuss them here.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 07-31-2008, 11:34 AM
    sc908 sc908 is offline
    Registered User
     
    Join Date: Jul 2008
    Posts: 9
    Incorrect table name '' in Dreamweaver

    Im trying to create a form to insert some data into my database. When i try to submit the form, i get this error message:
    Incorrect table name ''

    Heres the code dreamweaver inserted into the document:
    Code:
    <?php require_once('../Connections/dreamcs3.php'); ?>
    <?php
    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"] == "form2")) {
      $insertSQL = sprintf("INSERT INTO ``position`` (Type) VALUES (%s)",
                           GetSQLValueString($_POST['position'], "text"));
    
      mysql_select_db($database_dreamcs3, $dreamcs3);
      $Result1 = mysql_query($insertSQL, $dreamcs3) or die(mysql_error());
    }
    
    mysql_select_db($database_dreamcs3, $dreamcs3);
    $query_updateme = "SELECT * FROM `position`";
    $updateme = mysql_query($query_updateme, $dreamcs3) or die(mysql_error());
    $row_updateme = mysql_fetch_assoc($updateme);
    $totalRows_updateme = mysql_num_rows($updateme);
    ?>
    everything is in the database correctly since i can use phpmyadmin to insert the data. Maybe i should copy the php code that i can get into phpmyadmin then get rid of any junk code dreamweaver inserts
    Reply With Quote
      #2  
    Old 09-08-2009, 01:47 PM
    lsaranchova lsaranchova is offline
    Registered User
     
    Join Date: Sep 2009
    Posts: 1
    Hi SC908,
    I have the same troubles. Have you found a solution?
    Reply With Quote
      #3  
    Old 09-16-2009, 10:51 PM
    shelley7753 shelley7753 is offline
    Registered User
     
    Join Date: Sep 2009
    Posts: 1
    I am having the same problem. everything was fine before. i found that if you remove the two tildes that they place on either side of the table name, the operation works. But WHY should I have to do that every time. is there a bug in dreamweaver? i just got the cs4 or whatever a month ago, but this is the first time i have had this error.

    shelley
    Reply With Quote
      #4  
    Old 11-02-2009, 04:41 AM
    lionel_php lionel_php is offline
    Registered User
     
    Join Date: Nov 2009
    Posts: 1
    Quote:
    Originally Posted by shelley7753 View Post
    I am having the same problem. everything was fine before. i found that if you remove the two tildes that they place on either side of the table name, the operation works. But WHY should I have to do that every time. is there a bug in dreamweaver? i just got the cs4 or whatever a month ago, but this is the first time i have had this error.

    shelley
    Thanks Shelley,

    I've had the "two tildes that they place on either side of the table name" problem and you saved me some crazy moments ;-)

    then , do you even know now why it happens?

    Thanks

    Lionel
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    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 On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:22 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.