Jump to content

00falcon

Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

00falcon's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi All... i dont really know what i did... but i got my page working... Inside dreamweaver's site manager i set it to: Links relative to: Document as opposed to Site root... dont know why... but now all my update scripts work...
  2. What is my "Out put" being sent... i didnt think i had any...? Thanks...
  3. Hi Guys... After searching for hours.... and realizing that this is a common problem and usually quiet easily solved... i feel so bad for not being able to solve it... and having to ask... So... can some one have a look at my code... and see where im going wrong... I have checked for "White Space" and removed what i found... I have included my 'includes" in the file as opposed to including them. i have removed my session based login system. but still i can not see where im going wrong... I am quite new to php (Duh) i have written a simple insert and update scripts to achive what i want to do... but i now have a plug in that "plugs in" to dreamweavers insert and update function... so i would like to get this right... The code is all produced by Dreamweaver... I have built a test page totaly seperate from this.... using a differant DB Table... and i can get it to work as it shoud... I have removed all my code from this HTML page... and rebuilt it... but i get the same error... Sorry peoples for posting nearly 300 line of code.... But i am (stuck) the error is Warning: Cannot modify header information - headers already sent in /www/virtual/***/htdocs/assets/admin/containers/edit.php on line 66 sorry... and my 300 line of code is <?php virtual('/Connections/OrconDB.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_update"])) && ($_POST["MM_update"] == "updateContainer")) { $updateSQL = sprintf("UPDATE Con_Containers SET Con_RCN_Ref=%s, Con_Origin=%s, Contact=%s, Contact_Phone=%s, Contact_Email=%s, Con_Number=%s, Con_Seal=%s, `size`=%s, Con_Destination=%s, Carrier=%s, Con_Contents=%s, Con_Contents_Description=%s, Con_Value=%s, Con_Land_Date=%s, Con_Lift_Date=%s, Con_Arival_Date=%s, Con_Invoiced=%s WHERE id=%s", GetSQLValueString($_POST['Con_RCN_Ref'], "text"), GetSQLValueString($_POST['Con_Origin'], "text"), GetSQLValueString($_POST['contact'], "text"), GetSQLValueString($_POST['Contact_Phone'], "text"), GetSQLValueString($_POST['Contact_Email'], "text"), GetSQLValueString($_POST['Con_Number'], "text"), GetSQLValueString($_POST['Con_Seal'], "text"), GetSQLValueString($_POST['size'], "text"), GetSQLValueString($_POST['Con_Destination'], "text"), GetSQLValueString($_POST['carrier'], "text"), GetSQLValueString($_POST['Con_Contents'], "text"), GetSQLValueString($_POST['Con_Contents_Description'], "text"), GetSQLValueString($_POST['Con_Value'], "text"), GetSQLValueString($_POST['Con_Land_Date'], "text"), GetSQLValueString($_POST['Con_Lift_Date'], "text"), GetSQLValueString($_POST['Con_Arival_Date'], "text"), GetSQLValueString($_POST['Con_Invoiced'], "text"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_OrconDB, $OrconDB); $Result1 = mysql_query($updateSQL, $OrconDB) or die(mysql_error()); $updateGoTo = "update_ok.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } $colname_containers = "-1"; if (isset($_GET['id'])) { $colname_containers = $_GET['id']; } mysql_select_db($database_OrconDB, $OrconDB); $query_containers = sprintf("SELECT * FROM Con_Containers WHERE id = %s", GetSQLValueString($colname_containers, "int")); $containers = mysql_query($query_containers, $OrconDB) or die(mysql_error()); $row_containers = mysql_fetch_assoc($containers); $totalRows_containers = mysql_num_rows($containers); mysql_select_db($database_OrconDB, $OrconDB); $query_destinations = "SELECT * FROM Con_Destinations"; $destinations = mysql_query($query_destinations, $OrconDB) or die(mysql_error()); $row_destinations = mysql_fetch_assoc($destinations); $totalRows_destinations = mysql_num_rows($destinations); mysql_select_db($database_OrconDB, $OrconDB); $query_carrier = "SELECT * FROM con_Carriers"; $carrier = mysql_query($query_carrier, $OrconDB) or die(mysql_error()); $row_carrier = mysql_fetch_assoc($carrier); $totalRows_carrier = mysql_num_rows($carrier); mysql_select_db($database_OrconDB, $OrconDB); $query_size = "SELECT * FROM Con_Size"; $size = mysql_query($query_size, $OrconDB) or die(mysql_error()); $row_size = mysql_fetch_assoc($size); $totalRows_size = mysql_num_rows($size); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Your description goes here..." /> <link rel="stylesheet" type="text/css" href="../../css/style.css" title="1024px style" media="screen,projection" /> <title>RCN & Associates Ltd - E waste and Remarketing Leaders</title> </head> <body> <div id="wrap"> <div id="header"> <p id="toplinks"> Skip to: <a href="/index.php">Home</a> | <a href="/ewaste_pricing.php">E waste Prices</a> | <a href="/secure/index.php">Price List</a> | <a href="/flyer"> Sales Flyer</a> | <a href="/contactus.php">Contact us</a></p> </div> <div id="content"> <h1>Container Details...</h1> <div align="center"> <form action="<?php echo $editFormAction; ?>" method="POST" enctype="multipart/form-data" name="updateContainer" id="updateContainer"> <input name="id" type="hidden" id="id" /> <table width="670" border="0" class="border greyBackground"> <tr> <td><strong> Refferance : </strong></td> <td><input name="Con_RCN_Ref" type="text" id="Con_RCN_Ref" value="<?php echo $row_containers['Con_RCN_Ref']; ?>" /></td> <td><strong> Origin : </strong></td> <td><input name="Con_Origin" type="text" id="Con_Origin" value="<?php echo $row_containers['Con_Origin']; ?>" /></td> </tr> <tr> <td><strong>Container Number : </strong></td> <td><input name="Con_Number" type="text" id="Con_Number" value="<?php echo $row_containers['Con_Number']; ?>"></td> <td><strong> Destination : </strong></td> <td><select name="Con_Destination" id="Con_Destination"> <?php do { ?> <option value="<?php echo $row_destinations['Destination']?>"<?php if (!(strcmp($row_destinations['Destination'], $row_containers['Con_Destination']))) {echo "selected=\"selected\"";} ?>><?php echo $row_destinations['Destination']?></option> <?php } while ($row_destinations = mysql_fetch_assoc($destinations)); $rows = mysql_num_rows($destinations); if($rows > 0) { mysql_data_seek($destinations, 0); $row_destinations = mysql_fetch_assoc($destinations); } ?> </select></td> </tr> <tr> <td width="144"><strong>Seal Number :</strong></td> <td width="144"><input name="Con_Seal" type="text" id="Con_Seal" value="<?php echo $row_containers['Con_Seal']; ?>"></td> <td><strong>Carrier :</strong></td> <td width="195"><select name="carrier" id="carrier"> <?php do { ?> <option value="<?php echo $row_carrier['carrier']?>"<?php if (!(strcmp($row_carrier['carrier'], $row_containers['Carrier']))) {echo "selected=\"selected\"";} ?>><?php echo $row_carrier['carrier']?></option> <?php } while ($row_carrier = mysql_fetch_assoc($carrier)); $rows = mysql_num_rows($carrier); if($rows > 0) { mysql_data_seek($carrier, 0); $row_carrier = mysql_fetch_assoc($carrier); } ?> </select></td> </tr> <tr> <td width="144"><strong>Contents :</strong></td> <td width="144"><input name="Con_Contents" type="text" id="Con_Contents" value="<?php echo $row_containers['Con_Contents']; ?>"></td> <td><strong>Size :</strong></td> <td width="195"><select name="size" id="size"> <?php do { ?> <option value="<?php echo $row_size['size']?>"<?php if (!(strcmp($row_size['size'], $row_containers['size']))) {echo "selected=\"selected\"";} ?>><?php echo $row_size['size']?></option> <?php } while ($row_size = mysql_fetch_assoc($size)); $rows = mysql_num_rows($size); if($rows > 0) { mysql_data_seek($size, 0); $row_size = mysql_fetch_assoc($size); } ?> </select></td> </tr> <tr> <td><strong>Contents Description:</strong></td> <td colspan="3"><textarea name="Con_Contents_Description" id="Con_Contents_Description" cols="55" rows="5"><?php echo $row_containers['Con_Contents_Description']; ?></textarea></td> </tr> <tr> <td><strong>Perceived Value :</strong></td> <td><input name="Con_Value" type="text" id="Con_Value" value="<?php echo $row_containers['Con_Value']; ?>"></td> <td> </td> <td> </td> </tr> <tr> <td><strong>Land :</strong></td> <td><strong>Lift :</strong></td> <td><strong>Arrive at Destination :</strong></td> <td> </td> </tr> <tr> <td><input name="Con_Land_Date" type="text" id="Con_Land_Date" value="<?php echo $row_containers['Con_Land_Date']; ?>"></td> <td><input name="Con_Lift_Date" type="text" id="Con_Lift_Date" value="<?php echo $row_containers['Con_Lift_Date']; ?>"></td> <td><input name="Con_Arival_Date" type="text" id="Con_Arival_Date" value="<?php echo $row_containers['Con_Arival_Date']; ?>" /></td> <td> </td> </tr> <tr> <td><strong>Contact:</strong></td> <td><input name="contact" type="text" id="contact" value="<?php echo $row_containers['Contact']; ?>" /></td> <td><strong>Contact Phone:</strong></td> <td><input name="Contact_Phone" type="text" id="Contact_Phone" value="<?php echo $row_containers['Contact_Phone']; ?>" /></td> </tr> <tr> <td><strong>Contact Email:</strong></td> <td colspan="2"><input name="Contact_Email" type="text" id="Contact_Email" value="<?php echo $row_containers['Contact_Email']; ?>" size="45" /></td> <td></td> </tr> <tr> <td colspan="2"><input type="file" name="fileField" id="fileField" /></td> <td><strong>Invoiced </strong>Yes <input <?php if (!(strcmp($row_containers['Con_Invoiced'],"Yes"))) {echo "checked=\"checked\"";} ?> type="radio" name="Con_Invoiced" id="Con_Invoiced3" value="Yes" /> / No <input <?php if (!(strcmp($row_containers['Con_Invoiced'],"No"))) {echo "checked=\"checked\"";} ?> type="radio" name="Con_Invoiced" id="Con_Invoiced4" value="No" /></td> <td><input type="submit" name="button" id="button" value="Update Entry" /> </td> </tr> </table> <input type="hidden" name="MM_update" value="updateContainer" /> </form> </div> </div> <div id="sidebar"> <h2><font color="#FF0000">Administration ! </font></h2> <ul> <li><a href="/index.php">***</a></li> <li><a href="http://webmail.***" target="_blank">RCN Webmail</a> </li> <li><a href="http://dbadmin.***/phpmyadmin/" target="_blank">DB Admin</a></li> <li><a href="logoutAction.php">Log Out</a></li> </ul> <h2>Functions:</h2> <ul> <li><a href="/assets/admin/index.php">Admin Home </a></li> <li><a href="/assets/admin/containers/index.php">Containers</a></li> <li><a href="/assets/admin/containers/list.php">Container List</a> </li> <li><a href="/collections">Collections</a></li> <li><a href="/assets/admin/rma">RMA Requests </a> </li> <li><a href="blog/wp-admin/" target="_blank">Media Admin</a> </li> <li><a href="http://www.***.co.nz/admin/index.php" target="_blank">Battery Admin </a> </li> <li><a href="/assets/admin/flyeradmin">Flyer Admin </a></li> </ul> <h2>Pricelist:</h2> <ul> <li><a href="/assets/admin/desktops.php">Desktop Pricing </a></li> <li><a href="/assets/admin/laptops.php">Laptop Pricing </a> </li> <li><a href="/assets/admin/monitors.php">Monitor Pricing </a></li> <li><a href="/assets/admin/printers.php">Printer Pricing </a></li> <li><a href="/assets/admin/servers.php">Server Pricing </a></li> <li><a href="/assets/admin/users.php">Price List Users</a></li> <li><a href="/assets/admin/editUsers.php">Edit Price List Users</a> </li> </ul> <h2>Homeless:</h2> <ul> <li><a href="datacom_receipt_form.php">Datacom NZP Receipt Form >> </a></li> <li><a href="../../datacom/index.php">Datacom View Collections</a></li> <li><a href="../../dell">Dell Collections </a></li> </ul> </div> <div id="footer"> <p> </p> <p><a href="#">Contact us</a> | <a href="../../terms.php">Terms & Conditions </a> | <a href="../../sitemap.php">Sitemap</a> | <a href="#header">Back to top</a><br /> © 2008***F| Freelance design by <a href="http://www.****.net.nz">***</a> </p> </div> </div> </body> </html> <?php mysql_free_result($containers); mysql_free_result($destinations); mysql_free_result($carrier); mysql_free_result($size); ?>
  4. Hi Peoples... Somewhat new at PHP & MySQL... i have hand written some simple scripts to display insert and update my info in MySQL... and they all work (not neat... but they work...)... But it took me far too long... so i thought id try and use dreamweaver to do these simple functions... seamed to all go to plan.. Can insert... But cant update... Well.... it does update... but it doesnt forward me on to the correct page... I get the error Warning: Cannot modify header information - headers already sent in /www/virtual/****/htdocs/assets/admin/con_edit.php on line 64 No dreamweaver extensions used... so this is all from Dreamweaver CS3 I have been thru my file(s) and removed all the leading and trailing "white space" as google pointed me in this direction... can someone have a look at the code output by dreamweaver and see where im going wrong... Thanks <?php virtual('/Connections/OrconDB.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_update"])) && ($_POST["MM_update"] == "updateContainer")) { $updateSQL = sprintf("UPDATE Con_Containers SET Con_RCN_Ref=%s, Con_Origin=%s, Con_Number=%s, Con_Seal=%s, Con_Destination=%s, Con_Contents=%s, Con_Contents_Description=%s, Con_Value=%s, Con_Profit=%s, Con_Land_Date=%s, Con_Lift_Date=%s, Con_Departure_Date=%s, Con_Arival_Date=%s, Con_Finalisation_Date=%s, Con_Invoiced=%s WHERE id=%s", GetSQLValueString($_POST['Con_RCN_Ref'], "text"), GetSQLValueString($_POST['Con_Origin'], "text"), GetSQLValueString($_POST['Con_Number'], "text"), GetSQLValueString($_POST['Con_Seal'], "text"), GetSQLValueString($_POST['Con_Destination'], "text"), GetSQLValueString($_POST['Con_Contents'], "text"), GetSQLValueString($_POST['Con_Contents_Description'], "text"), GetSQLValueString($_POST['Con_Value'], "text"), GetSQLValueString($_POST['Con_Profit'], "text"), GetSQLValueString($_POST['Con_Land_Date'], "text"), GetSQLValueString($_POST['Con_Lift_Date'], "text"), GetSQLValueString($_POST['Con_Departure_Date'], "text"), GetSQLValueString($_POST['Con_Arival_Date'], "text"), GetSQLValueString($_POST['Con_Finalisation_Date'], "text"), GetSQLValueString($_POST['Con_Invoiced'], "text"), GetSQLValueString($_POST['id'], "int")); mysql_select_db($database_OrconDB, $OrconDB); $Result1 = mysql_query($updateSQL, $OrconDB) or die(mysql_error()); $updateGoTo = "/assets/admin/containers.php"; if (isset($_SERVER['QUERY_STRING'])) { $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } $colname_containers = "-1"; if (isset($_GET['id'])) { $colname_containers = $_GET['id']; } mysql_select_db($database_OrconDB, $OrconDB); $query_containers = sprintf("SELECT * FROM Con_Containers WHERE id = %s", GetSQLValueString($colname_containers, "int")); $containers = mysql_query($query_containers, $OrconDB) or die(mysql_error()); $row_containers = mysql_fetch_assoc($containers); $totalRows_containers = mysql_num_rows($containers); mysql_select_db($database_OrconDB, $OrconDB); $query_destinations = "SELECT * FROM Con_Destinations"; $destinations = mysql_query($query_destinations, $OrconDB) or die(mysql_error()); $row_destinations = mysql_fetch_assoc($destinations); $totalRows_destinations = mysql_num_rows($destinations); ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Your description goes here..." /> <meta name="keywords" content="your,keywords,goes,here" /> <meta name="author" content="Your Name" /> <link rel="stylesheet" type="text/css" href="../css/style.css" title="1024px style" media="screen,projection" /> <title>RCN & Associates Ltd - E waste and Remarketing Leaders</title> </head> <body> <div id="wrap"> <div id="header"> <p id="toplinks"> <?php include('../../toplinks.php') ?> </p> </div> <div id="content"> <h1>Container Details...</h1> <div align="center"> <form action="<?php echo $editFormAction; ?>" method="POST" name="updateContainer" id="updateContainer"> <input name="id" type="hidden" id="id" value="<?php echo $row_containers['id']; ?>" /> <table width="670" border="0" class="border greyBackground"> <tr> <td colspan="2">RCN Refferance : <input name="Con_RCN_Ref" type="text" id="Con_RCN_Ref" value="<?php echo $row_containers['Con_RCN_Ref']; ?>"></td> <td colspan="2">Container Origin : <input name="Con_Origin" type="text" id="Con_Origin" value="<?php echo $row_containers['Con_Origin']; ?>"></td> </tr> <tr> <td>Container Number : </td> <td><input name="Con_Number" type="text" id="Con_Number" value="<?php echo $row_containers['Con_Number']; ?>"></td> <td>Container Destination : </td> <td><select name="Con_Destination" id="Con_Destination"> <?php do { ?> <option value="<?php echo $row_destinations['Destination']?>"<?php if (!(strcmp($row_destinations['Destination'], $row_containers['Con_Destination']))) {echo "selected=\"selected\"";} ?>><?php echo $row_destinations['Destination']?></option> <?php } while ($row_destinations = mysql_fetch_assoc($destinations)); $rows = mysql_num_rows($destinations); if($rows > 0) { mysql_data_seek($destinations, 0); $row_destinations = mysql_fetch_assoc($destinations); } ?> </select></td> </tr> <tr> <td width="136">Seal Number :</td> <td width="168"><input name="Con_Seal" type="text" id="Con_Seal" value="<?php echo $row_containers['Con_Seal']; ?>"></td> <td width="139">Container Contents :</td> <td width="209"><input name="Con_Contents" type="text" id="Con_Contents" value="<?php echo $row_containers['Con_Contents']; ?>"></td> </tr> <tr> <td>Contents Description:</td> <td colspan="3"><textarea name="Con_Contents_Description" id="Con_Contents_Description" cols="55" rows="5"><?php echo $row_containers['Con_Contents_Description']; ?></textarea></td> </tr> <tr> <td>Value :</td> <td><input name="Con_Value" type="text" id="Con_Value" value="<?php echo $row_containers['Con_Value']; ?>"></td> <td>Profit :</td> <td><input name="Con_Profit" type="text" id="Con_Profit" value="<?php echo $row_containers['Con_Profit']; ?>"></td> </tr> <tr> <td>Land at RCN :</td> <td>Lift from RCN :</td> <td>Depart Auckland :</td> <td>Arrive at Destination :</td> </tr> <tr> <td><input name="Con_Land_Date" type="text" id="Con_Land_Date" value="<?php echo $row_containers['Con_Land_Date']; ?>"></td> <td><input name="Con_Lift_Date" type="text" id="Con_Lift_Date" value="<?php echo $row_containers['Con_Lift_Date']; ?>"></td> <td><input name="Con_Departure_Date" type="text" id="Con_Departure_Date" value="<?php echo $row_containers['Con_Departure_Date']; ?>"></td> <td><input name="Con_Arival_Date" type="text" id="Con_Arival_Date" value="<?php echo $row_containers['Con_Arival_Date']; ?>"></td> </tr> <tr> <td colspan="2">Expected Finalisation Date:</td> <td colspan="2">Invoiced : Yes <input <?php if (!(strcmp($row_containers['Con_Invoiced'],"Yes"))) {echo "checked=\"checked\"";} ?> type="radio" name="Con_Invoiced" id="Con_Invoiced2" value="Yes" /> / No <input <?php if (!(strcmp($row_containers['Con_Invoiced'],"No"))) {echo "checked=\"checked\"";} ?> type="radio" name="Con_Invoiced" id="Con_Invoiced" value="No" /></td> </tr> <tr> <td colspan="2"><input name="Con_Finalisation_Date" type="text" id="Con_Finalisation_Date" value="<?php echo $row_containers['Con_Finalisation_Date']; ?>" /></td> <td>ID:</td> <td><input type="submit" name="button" id="button" value="Update Entry" /> <a><img src="/assets/admin/delEntry.gif" alt="" width="70" height="20" /></a></td> </tr> </table> <input type="hidden" name="MM_update" value="updateContainer" /> </form> </div> </div> <div id="sidebar"> <?php include('adminMenu.php'); ?> </div> <div id="footer"> <p> </p> </div> </div> </body> </html> <?php mysql_free_result($containers); mysql_free_result($destinations); ?>
  5. Hi... Thanks for the reply... excuse my ignorance.... but i don't quite under stand... What i was thinking was... I have about 12 differant brand (ie. acer, sony, ibm, toshiba, etc) incorporating about 60 -70 different batteries... with those 60 - 70 different batteries suitable for over 200 different model types... My assumed DB structure was something like id date_in out (being out of stock) make model oem_number compatible_number battery_spec (probably would be more than one field) internal_code price What i am trying to achive is something like: http://www.laptopbattery.co.nz/products.asp?product_no=17424 with the "Compatible Model Numbers" down the bottom Thanks in advance for any help...
  6. Hi All... I don't even know if im on the right track... But... I just recently learned how to Insert, Update, Delete and Display basic data being pulled from a mysql Database... What i want to do now is have one field named "compatible models" and inserted into that would be something like: 310-4482 312-0191 312-0309 315-0084 D510/D610 U1544 W1605 0X217 1X793 310-4482 310-5195 312-0068 312-0191 312-0309 315-0084 Now... is it possible to get php/mysql to seperate the data each time it comes across a space...? I want to list the "Laptop Battery" and all of its relevant spec... and underneath that... i want to neatly display a list of the "Compatible models" As i said... im not even sure if im on the right track... if someone could point me in the right direction.... am sure i could find a tutorial from there Thanks
  7. Thanks Darren.... That worked a treat.... your a life saver....
  8. Hi all... as you can gather from posting in this forum... i am very new to this... (PHP & MySQL) But what i have is a site... that displays what computers we have in stock and for sale... When stock items need to be changed... i tried to do an UPDATE by loading the current values into a form field as the initial values from the data in a MySQL table... So far... My Select, Insert, Delete and Update are all working... But when i load the page containing the form to be populated... it only loads the first word of the data... look like a space is getting in the way... But as i said... noobe... ------------------------------- Troubled Code <?php include('config.php'); $id=$_GET['id']; $query = "SELECT * FROM desktops WHERE id='$id'"; $result = mysql_query($query) or die(mysql_error()); while( $row = mysql_fetch_array($result)) { echo "<form id=desktops_update name=desktops_update action=desktops_update.php method=\"POST\">"; echo "<table width=800 border=0 cellspacing=0 cellpadding=0>"; echo "<tr>"; echo "<td width=378 rowspan=13 align=center valign=middle><strong>Quick Add Item </strong><br>"; echo "<img src=../images/Qadd-desktop.jpg width=200 height=161></td>"; echo "<tr>"; echo "<td><strong>ID:</strong></td>"; echo "<td><input name=id type=text id=id size=25 value=".$row[id]."></td>"; echo "</tr>"; echo "<td width=176><strong>Make:</strong></td>"; echo "<td width=246>"; echo "<input name=make type=text id=make size=25 value=".$row[make]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Model:</strong></td>"; echo "<td><input name=model type=text id=model size=25 value=".$row[model]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Code:</strong></td>"; echo "<td><input name=code type=text id=code size=25 value=".$row[code]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Proc:</strong></td>"; echo "<td><input name=proc type=text id=proc size=25 value=".$row[proc]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Ram:</strong></td>"; echo "<td><input name=ram type=text id=ram size=25 value=".$row[ram]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Hard Drive : </strong></td>"; echo "<td><input name=hdd type=text id=hdd size=25 value=".$row[hdd]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Optical:</strong></td>"; echo "<td><input name=optical type=text id=optical size=25 value=".$row[optical]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>License:</strong></td>"; echo "<td><input name=lic type=text id=li size=25 value=".$row[lic]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Other:</strong></td>"; echo "<td><input name=other type=text id=other size=25 value=".$row[other]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Price:</strong></td>"; echo "<td><input name=price type=text id=price size=25 value=".$row[price]."></td>"; echo "</tr>"; echo "<tr>"; echo "<td><strong>Admin Notes : </strong></td>"; echo "<td><input name=adminnote cols=25 rows=2 id=adminnote value=".$row[adminnote]."></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td> </td>"; echo "<td><input type=submit name=Submit value=\"Update Entry\" /></td>"; echo "</tr>"; echo "</table>"; echo "</form>"; } ?> Any advise would be much appreciated... I am stuck on this... Thanks[/code]
×
×
  • 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.