Jump to content

dchapma123

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dchapma123's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to create a simple record insertion form in Dreamweaver MX. I create a simple recordset, then I create a form. Then I select Insert Record from the menu. I've done is on several pages with no problem at all. But I've got one table that Dreamweaver just won't allow me to add records to. In the Server Behavior box, next to the Record Insertion behavior, is a red exclamation point. When I open it, I get a dialogue box that says "Could not find the selected tag node." I've been all over the Internet trying to figure out what this means and how to fix it. I've found a few postings similar to the one I'm making now, but nobody ever gets an answer (including on the Macromedia forums). Is this a Dreamweaver bug? Or am I just missing something? Here's the code: <?php require_once('../../Connections/CDBlog.php'); function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO tblspecs VALUES (NULL, %s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['projectid'], "int"), GetSQLValueString($HTTP_POST_VARS['medium'], "text"), GetSQLValueString($HTTP_POST_VARS['length'], "text"), GetSQLValueString($HTTP_POST_VARS['color'], "text"), GetSQLValueString($HTTP_POST_VARS['completion'], "date"), GetSQLValueString($HTTP_POST_VARS['daterange'], "text"), GetSQLValueString($HTTP_POST_VARS['venue'], "text")); mysql_select_db($database_CDBlog, $CDBlog); $Result1 = mysql_query($insertSQL, $CDBlog) or die(mysql_error()); $insertGoTo = "projects.php"; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } mysql_select_db($database_CDBlog, $CDBlog); $query_rsSpecs = "SELECT * FROM tblspecs"; $rsSpecs = mysql_query($query_rsSpecs, $CDBlog) or die(mysql_error()); $row_rsSpecs = mysql_fetch_assoc($rsSpecs); $totalRows_rsSpecs = mysql_num_rows($rsSpecs); ?> <form name="form1" method="post" action=""> <p>Project: <input name="projectid" type="text" id="projectid"> </p> <p>Medium: <input name="medium" type="text" id="medium"> </p> <p>Length: <input name="length" type="text" id="length"> </p> <p>Color: <input name="color" type="text" id="color"> </p> <p>Completion Date: <input name="completion" type="text" id="competion"> </p> <p>Date Range: <input name="daterange" type="text" id="daterange"> </p> <p>Venue: <input name="venue" type="text" id="venue"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> <?php mysql_free_result($rsSpecs); ?>
  2. I'm hoping someone can help me with this. It seems like it should be a pretty simple thing to do, so I'm probably missing something small. I have a database with review articles in it. On my index page, I have a link to the most recent article. I do this by using Dynamic Text in Dreamweaver to show the article title from the recordset, then have create a hyperlink from the article with the following: name=idreview, parameter=<?php echo $row_rsReviews['idreview']; ?>. This link opens in a page called review.php, and works fine. However, on the review.php page, I have a list of the other articles in the database. My intention is to make them linkable as well, and have them also open in review.php (where the first article opens). I create the links the same way, but they don't open. I've even tried having them open in a different page, but it just blinks and stays with the initial (most recent) article. I'm pretty new to PHP and MySQL, so I'm not sure what's going on. I'm wondering if I need to write an extra query perhaps, but I can't see why? If I've got the record ID, should it bring up the record? Help me out? Thanks, Dave...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.