Jump to content

Drauka

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Drauka's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Dear all, I have a problem I can't really wrap my head around, maybe someone here can help. I read data from a xls-sheet every month and put it into a table. To make it easy here, there are two things which I use to identify an entry: the date added and the product number. Both can't be unique, because the product number might be added the following month again. Here it might be more useful to not create a completely new entry in the database, but to just reference for what month the prouct should be listed. How can I do that? My problem now is: when adding a new set of data, I want to select all new entries for the current month, that were not in the database last month. So I basically want to select all new entries, but not those, that were already in the database last month. What is the easiest way to do that? Can I do it with one table, or should I use different tables that are referencing to each other? Thank you for your help. Best regards
  2. I just wanted to say a big THANK YOU! It works now
  3. HI again. Here' the HTML: <html> <head> <title>Verwaltung DB</title> <meta name="author" content="alex"> </head> <style type="text/css" title="currentStyle" media="screen"> @import "css/style.css"; </style> <body> <p><a href="new.php">neuen Fall eintragen</a></p> UPDATE rma SET status = '3' WHERE id = '1'<br> UPDATE rma SET status = '' WHERE id = ''<br> UPDATE rma SET status = '' WHERE id = ''<br> UPDATE rma SET status = '' WHERE id = ''<br> UPDATE rma SET status = '' WHERE id = ''<br> UPDATE rma SET status = '' WHERE id = ''<br> <form action="index.php" method="post"> <table width="750" border="0" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#555555"> <table width="100%" cellspacing="1" cellpadding="1" border="0"> <tr> <td bgcolor="#555555"><b><a href="index.php?sort=rma_no">DB RMA#</a></b></td> <td bgcolor="#555555"><b>Name</b></td> <td bgcolor="#555555"><b>S/N</b></td> <td bgcolor="#555555"><b>SKU</b></td> <td bgcolor="#555555"><b>P/N</b></td> <td bgcolor="#555555"><b><a href="index.php?sort=status">Status</a></b> </td> <td bgcolor="#555555"><b>Details</b></td> </tr> <tr> <td bgcolor="#034A9A"> <input type="hidden" name="ID[]" value="1"></input> <a href="details.php?id=1">DB000001</a> </td> <td bgcolor="#034A9A"><a href="details.php?id=1">Name 1</a></td> <td bgcolor="#034A9A">A054600149081</td> <td bgcolor="#034A9A">sku1</td> <td bgcolor="#034A9A">pn1</td> <td bgcolor="#034A9A"> <select name="status[]"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3" selected="selected">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> <option value="6">Option 6</option> <option value="7">Option 7</option> <option value="8">Option 8</option> <option value="9">Option 9</option> </select> </td> <td bgcolor="#034A9A"><a href="details.php?id=1">Details</a></td> </tr> <tr> <td bgcolor="#034A9A"><input type="hidden" name="ID[]" value="2"></input><a href="details.php?id=2">DB000002</a></td> <td bgcolor="#034A9A"><a href="details.php?id=2">Name 2</a></td> <td bgcolor="#034A9A">A045100147912</td> <td bgcolor="#034A9A">fehlt</td> <td bgcolor="#034A9A">99-LC00-1D-FS</td> <td bgcolor="#034A9A"> <select name="status[]"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> <option value="6" selected="selected">Option 6</option> <option value="7">Option 7</option> <option value="8">Option 8</option> <option value="9">Option 9</option> </select> </td> <td bgcolor="#034A9A"><a href="details.php?id=2">Details</a></td> </tr> <tr> <td bgcolor="#034A9A"><input type="hidden" name="ID[]" value="3"></input><a href="details.php?id=3">DB000003</a></td> <td bgcolor="#034A9A"><a href="details.php?id=3">Name 3 </a></td> <td bgcolor="#034A9A">A060100012135</td> <td bgcolor="#034A9A">fehlt</td> <td bgcolor="#034A9A">fehlt</td> <td bgcolor="#034A9A"> <select name="status[]"> <option value="1">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> <option value="6">Option 6</option> <option value="7" selected="selected">Option 7</option> <option value="8">Option 8</option> <option value="9">Option 9</option> </select> </td> <td bgcolor="#034A9A"><a href="details.php?id=3">Details</a></td> </tr> <tr> <td bgcolor="#034A9A"><input type="hidden" name="ID[]" value="4"></input><a href="details.php?id=4">DB000004</a></td> <td bgcolor="#034A9A"><a href="details.php?id=4"></a></td> <td bgcolor="#034A9A"></td> <td bgcolor="#034A9A"></td> <td bgcolor="#034A9A"></td> <td bgcolor="#034A9A"> <select name="status[]"> <option value="1" selected="selected">Option 1</option> <option value="2">Option 2</option> <option value="3">Option 3</option> <option value="4">Option 4</option> <option value="5">Option 5</option> <option value="6">Option 6</option> <option value="7">Option 7</option> <option value="8">Option 8</option> <option value="9">Option 9</option> </select> </td> <td bgcolor="#034A9A"><a href="details.php?id=4">Details</a></td> </tr> </table> </td> </tr> </table> <input type="submit" name="updaten" value="Save" style="margin-left: 15px;""></input> </form> </body> </html> I deleted the last entries, because it's all the same and it would just take up space here.
  4. So, could you maybe give me a hint how to change that, please?
  5. I've got 6 entries in the list and it echos this: UPDATE rma SET status = '1' WHERE id = '1' UPDATE rma SET status = '' WHERE id = '' UPDATE rma SET status = '' WHERE id = '' UPDATE rma SET status = '' WHERE id = '' UPDATE rma SET status = '' WHERE id = '' UPDATE rma SET status = '' WHERE id = ''
  6. Hi all. I really hope you can help me with this, but I'm really stuck and don't really know what I've done wrong. Situation is as follows: I have a list of entries from a DB. Each of those entries has a field 'status'. What I want to do now is change the status for multiple rows with just one submit. What I have is this: if (isset($_POST["updaten"])) { foreach ($_POST['ID'] as $key => $values) { $ID = $_POST['ID'][$key]; $status_change = $_POST['status'][$key]; $sql_stat = " UPDATE rma SET status = '".$status_change[$key]."' WHERE id = '".$ID[$key]."'"; echo $sql_stat.'<br>'; mysql_query($sql_stat) or die (mysql_error()); } } and in the form there is this: echo '<input type="hidden" name="ID[]" value="'.$row[id].'"></input>'; echo '<select name="status[]">'; echo "<option value=\"1\""; if ($status == '1') {echo " selected=\"selected\"";} echo ">Status 1</option>"; echo "<option value=\"2\""; if ($status == '2') {echo " selected=\"selected\"";} echo ">Status 3</option>"; echo "<option value=\"3\""; if ($status == '3') {echo " selected=\"selected\"";} echo ">Status 3</option>"; ^^Sorry the html part still looks a little crappy... No matter how many fields I change in the list then, only the first entry changes. So it works for the first entry, not for the rest. Maybe someone can help me with this? Thank you very much! Best regards Alex
  7. Sorry for bumping this, but anyone? Please?
  8. Hi. I try to read the data from a FDF file, but as of now, I was unable to even open it. I'm running Windows XP with XAMPP 1.5.5 (so PHP 5.2.0). phpinfo tells me fdf-Support is enabled and fdftk.dll version is 5.0. When I try the following code: if (file_exists("test.fdf")) { echo "File exists<br>"; if (is_readable("test.fdf")) { echo "File is readable<br>"; $fdf = fdf_open("test.fdf"); if ($fdf) { echo "everything is fine, lets go!"; } else { echo "Error: "; echo fdf_error(fdf_errno()); } } else { echo "cannot read file"; } } else { echo "file doesn't exist"; } I get the following result: File exists. File is readable. Error: A file system error occurred or the file was not found What am I doing wrong here? Any ideas? Thank you!
×
×
  • 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.