Jump to content

iwpg

Members
  • Posts

    59
  • Joined

  • Last visited

Everything posted by iwpg

  1. Thanks for your help. I looked everywhere for update query examples on arrays in MYSQL, but didn't have any luck. Do I need to loop the $id variable through the array like the $commissions variable? I'm just kindof stuck with this part. ???
  2. This has got me stumped. I am trying to update a table where a record ID = to the post ID with values. No luck at all. This is what I have so far: $commissions = preg_split('/\r\n|\n/', $_POST['commission'], -1, PREG_SPLIT_NO_EMPTY); $id = preg_split('/\r\n|\n/', $_POST['id'], -1, PREG_SPLIT_NO_EMPTY); //Iterate through array foreach ($data as $val) { mysql_query("insert into $table (commissions) values ('$commissions') WHERE id ='$id'"); } My form looks like: <input type="text" name="id" id="id[]" size="7" value="3"> <input type="text" name="commission" id="commission[]" size="15" value="100.00"> Any help will be GREATLY appreciated.
  3. Just what I needed. I really do appreciate you helping me out on this. Many thanks. Mike
  4. Thanks, I got rid of the error, but only 1 result of the multiple checkboxes will delete. It doesn't loop through the rest of them. This is my code: elseif ($action=='postdelete'){ $id = array(); $id[] = $_POST['kwcb']; if (count($id) > 0) { foreach ($id as $removeid) { mysql_query("delete from table where kw='$removeid'"); } } }
  5. Sorry, I fogot to mention that the above outputs: Invalid argument supplied for foreach() Thanks again - mike
  6. Thanks for the much needed help. The insert new records function is working perfectly. Many thanks... Now, I am having trouble removing multiple records by using a checkbox. This is what I have: $id = array(); $id = $_POST['kwcb']; if (count($id) > 0) { foreach ($id as $removeid) { mysql_query("delete from table where kw='$removeid'"); } } Thanks again. Mike
  7. Hi guys, I have been pulling my hair out trying to find a good example on this. ??? I know that arrays play the main theme in the function, and I am an array flunkie. I have a textarea, where I am inserting 1 item per line and I am trying to get it to upload to my mysql database. This is kind of like the Google Adwords "add keywords" function. I also need to be able to remove selected values once they're in the db using a checkbox. I just have no way of handling the submitted data, and inserting it. Any help is GREATLY appreciated. Thanks, Mike
  8. Just found out that mysteriouslly, my httpd.conf file had a line removed: LoadModule php4_module /usr/local/apache/libexec/libphp4.so Hope this may help anyone so they don't have 24 hours of high blood pressure ??? Mike
  9. I'm having the same problem and really, really need some help. $50 with Paypal for anyone that solves this for me. I tried CS at CIHost.com and no help! Site has been down for nearly 7 hours now. I'm running Apache 2.0 with php 4.3.1. Don't know what happened, but all of my scripts started opening instead of parsing. I tried loading the php4 module, and the site cannot be displayed. I followed the install instructions and it made the site unreadable. Any clues on this one? I'm a novice with Apache/PHP setup, so please understand. Thanks, Mike
×
×
  • 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.