Jump to content

RidgeandGable

Members
  • Posts

    90
  • Joined

  • Last visited

RidgeandGable's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. SELECT Name, Town, Category FROM customer1 WHERE Name = colname Code is above (Dreamweaver CS6) ​I need Where Name & Town to filter on? Any help?
  2. <?php require_once('Connections/New.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $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; } } if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) { $deleteSQL = sprintf("DELETE FROM customer1 WHERE ID=%s", GetSQLValueString($_GET['ID'], "int")); mysql_select_db($database_New, $New); $Result1 = mysql_query($deleteSQL, $New) or die(mysql_error()); $deleteGoTo = "success.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $deleteGoTo)); } if ((isset($_GET['ID'])) && ($_GET['ID'] != "")) { $deleteSQL = sprintf("DELETE FROM customer1 WHERE ID=%s", GetSQLValueString($_GET['ID'], "int")); mysql_select_db($database_New, $New); $Result1 = mysql_query($deleteSQL, $New) or die(mysql_error()); } $colname_DetailRS1 = "-1"; if (isset($_GET['recordID'])) { $colname_DetailRS1 = $_GET['recordID']; } mysql_select_db($database_New, $New); $query_DetailRS1 = sprintf("SELECT * FROM customer1 WHERE ID = %s ORDER BY `last Updated` ASC", GetSQLValueString($colname_DetailRS1, "int")); $DetailRS1 = mysql_query($query_DetailRS1, $New) or die(mysql_error()); $row_DetailRS1 = mysql_fetch_assoc($DetailRS1); $totalRows_DetailRS1 = mysql_num_rows($DetailRS1); $colname_recordset1 = "-1"; if (isset($_GET['RecordID'])) { $colname_recordset1 = $_GET['RecordID']; } mysql_select_db($database_New, $New); $query_recordset1 = sprintf("SELECT * FROM `comment` WHERE CustomerID = %s", GetSQLValueString($colname_recordset1, "int")); $recordset1 = mysql_query($query_recordset1, $New) or die(mysql_error()); $row_recordset1 = mysql_fetch_assoc($recordset1); $totalRows_recordset1 = mysql_num_rows($recordset1); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <table width="200" border="1"> <tr> <th scope="row"><?php echo $row_Recordset1['ID']; ?></th> <td><?php echo $row_Recordset1['CustomerID']; ?></td> <td><?php echo $row_Recordset1['Comment']; ?></td> </tr> </table> <table border="1" align="center"> <tr> <td width="77">ID</td> <td width="248"><?php echo $row_DetailRS1['ID']; ?></td> </tr> <tr> <td>Name</td> <td><?php echo $row_DetailRS1['Name']; ?></td> </tr> <tr> <td>Address</td> <td><?php echo $row_DetailRS1['Address']; ?></td> </tr> <tr> <td>Postcode</td> <td><?php echo $row_DetailRS1['Postcode']; ?></td> </tr> <tr> <td>Town</td> <td><?php echo $row_DetailRS1['Town']; ?></td> </tr> <tr> <td>Telephone</td> <td><?php echo $row_DetailRS1['Telephone']; ?></td> </tr> <tr> <td>Email</td> <td><?php echo $row_DetailRS1['Email']; ?></td> </tr> <tr> <td>Category</td> <td><?php echo $row_DetailRS1['Category']; ?></td> </tr> <tr> <td height="163">Notes</td> <td><?php echo $row_DetailRS1['Notes']; ?></td> </tr> <tr> <td>last Updated</td> <td><?php echo $row_DetailRS1['last Updated']; ?></td> </tr> </table> <p><br /> </p> <p><br /> </p> <p> </p> <p> </p> <p><br /> </p> </body> </html><?php mysql_free_result($DetailRS1); mysql_free_result($recordset1); ?>
  3. Hi Guys Building a little play database where tradesmen can "black list" bad customers and any tradesman can log in and check the customer file to see if anything is on it - ie Avoid, he doesn't pay etc ​I have the record sets etc created and have the dynamic tables displaying the record for a particular town / city etc, but I want to allow registered user somewhere they can add further comments. ​So I created a new table Called "Comments" and it has ID, CustomerID and comment. ​I'm using Dreamwaver CS6 to build the page and used the master detail page to create the tables etc to display.. But I can't seem to get anything working with the comment area. ​When you click on a customersID, it goes to /moreinfo.php?recordID=1 and in the recordset for the comments, I have it set to filter on URL - recordID ​and I get Notice: Undefined Variable: row_recordset1 etc etc ​Any help?
×
×
  • 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.