
nimzie
Members-
Posts
43 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
nimzie's Achievements

Member (2/5)
0
Reputation
-
Adding to the next element in a multidimensional array
nimzie replied to nimzie's topic in PHP Coding Help
thank you kindly for your help. -
Adding to the next element in a multidimensional array
nimzie replied to nimzie's topic in PHP Coding Help
I think what it has to do as it loops through the values to add is something like $node->field_spaces[0]['nid'] = $nid; $node->field_spaces[1]['nid'] = $nid; $node->field_spaces[2]['nid'] = $nid; $node->field_spaces[3]['nid'] = $nid; automatically as I iterate through things.... thank you for any help. cheers, adam -
Hi, I'm trying to add a value to $node->field_spaces[x]['nid'] where x is the next available spot in the field_spaces array. Always adding to the next spot. I'll be calling this in a for loop to add things in there... Can anyone offer a hand? $node->field_spaces (array) $node->field_spaces[0] (array) $node->field_spaces[0]['nid'] Thank you, adam
-
question on calling a function (should be a simple one)
nimzie replied to nimzie's topic in PHP Coding Help
I know this is almost a ridiculous question, but I can't figure out the &$ bit and how to init/call/use this function in my code. Pretty please help! Adam -
function relatedcontent_get_nodes(&$node) { $nodes = $node->nodes; // Keeps $node immutable. asort($nodes, SORT_NUMERIC); return array_keys($nodes); } How do I call it and how must I initialize &$node? Thanks for your assistance. Adam
-
Hi, as my subject says, this is likely something I should be aware of. A simple import script which is something like: for($i=1; $i<sizeof($fcontents); $i++) { $line = trim($fcontents[$i]); $arr = explode( $delim , $line); $arr = explode( "\t" , $line); $sql = "insert into origin ( StoreID, OrderID, OrderNumber, OrderDate, IpAddress, Currency, CustomerID, BillFirstName, BillLastName,BillEmail,BillPhone,BillFax,BillCompany,BillAddress,BillCity,BillState,BillCountry, BillZIP,ShipFirstName,ShipLastName,ShipEmail,ShipPhone,ShipFax,ShipCompany,ShipAddress,ShipCity, ShipState,ShipCountry,ShipZip,Status,Comments,ShippingMethod,ShippingCost,ShippingTaxes,HandlingCost, ShippingDate,DeliveryDate,ValidationCode,PaymentMethod,PaymentCost,Coupon,AddOns,AddonValues,PaymentTaxes, CardNumber,CardName,CardExpiry,TransactionDate,PreAuthNumber,AuthNumber,ReferenceNumber,Questions,ShortQuestions, ItemID,ItemName,ItemCode,ItemType,Options,OptionCode,Quantity,ItemPrice,Taxes,Width,Length,Height,LengthUnit, Weight,WeightUnit,Language ) values (' " . implode ( "','" , $arr) . "')"; One of the fields contained "Mary's store". It failed the SQL Statement. Can anyone share some tips on how to get around this? Thanks. Adam
-
it seems like something is failing but php isn't reporting it. Has anyone had this problem? Should I try upgrading to php5?
-
// Start XML file, create parent node $doc = domxml_new_doc("1.0"); $node = $doc->create_element("markers"); $parnode = $doc->append_child($node); gives me: Warning: domnode::append_child() expects parameter 1 to be object, null given in C:\xampp\htdocs\xampp\origin\admin\google\index.php on line 7 I'm not sure I understand.. I checked to see that domxml is there and working. It is... I'm assuming $doc is getting created, cause it's not giving any info @ the create_element command... I think I am using php4.
-
Trying to use the function: <?php if(function_exists('domxml_open_file')){ echo "domxml_open_file OK"; }else{ echo "domxml_open_file not OK"; } ?> To see if I can use the DOM functions. I can't. I checked. The php_domxml.dll file is present in my extensions. I checked my php.ini file. The extentions line pointing to the dll is not commented out, it reads:] extension_dir = "C:\xampp\php\extensions\" extension=php_domxml.dll I change that stuff, save the file and the script runs no differently... It appears I have a PHP.ini file in: C:\xampp\php, C:\xampp\apache\bin, C:\xampp\php\php4 and things are likely a mess here with this server .. What shoudl I do? I changed it in the dir/file my extensions directory is pointing to. Thanks , Adam edit .. restarted apache after changing the php4 file and it's working...
-
I found this script: <script language="JavaScript"> function Checkall(form){ for (var i = 1; i < form.elements.length; i++){ eval("form.elements[" + i + "].checked = form.elements[0].checked"); } } </script> Trying to go through this table and check / uncheck all the checkboxes as anyone would expect a check all checkbox to do... I build the table with a loop/php from a query, so there can be many records. Right now, if I check 3 checkboxes in the table, then click check all, they all uncheck. The "check all" control isn't getting checked when I click it and if I click the main one without anything checked, it appears as if nothing happens. No checkboxes in the table do anything. Please advise Thanks, Adam <form name="myForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"> <input type="checkbox" onClick="Checkall('myForm');" />Check all Records<br /> <table> <tr> <td>Process Order</td> <td>OrderID</td> </tr> <tr> <td> <input type="checkbox" name="checkbox" ><br /> </td> <td>orderid</td> </tr> </table> </form>
-
[SOLVED] Processing a table of checkboxes / records.
nimzie replied to nimzie's topic in PHP Coding Help
Thank you Ken. Appreciate your suggestion -
[SOLVED] Processing a table of checkboxes / records.
nimzie replied to nimzie's topic in PHP Coding Help
This is likely pretty hacky code, but does what I need: $name = $_POST['checkbox']; if(count($name) > 0){ $BatchIDs = "("; foreach($name AS $names){ $BatchIDs .= "$names,"; }//foreach $BatchIDs = substr_replace($BatchIDs ,"",-1); $BatchIDs = $BatchIDs . ")"; Anyone got any comments on how to make this sexier? Thanks, Adam -
[SOLVED] Processing a table of checkboxes / records.
nimzie replied to nimzie's topic in PHP Coding Help
I have gotten a chance to work on this piece a little again and ran in to something else... foreach($name AS &$names){ $key = $key + 1; echo "Key is " . $key . "<br />"; if ( $key = 1 ){ $BatchIDs = "($names"; } else if ( $key < $theCount ){ $BatchIDs .= "$names,"; } else { $BatchIDs .= "$names)"; } //else }//foreach } //if(count)>0 else { echo "There are no orders to process. Please check the applicable orders to be sent for processing.\n"; } This echos 1,2,2,2,2,2. It should echo 1,2,3,4,5,6 according to the # of iterations in the loop. I found a writeup about a bug related to foreach in php but it doesn't speak of a workaround for a situation like what I'm in. Should I even be using a foreach loop? I'm basically trying to build a SQL command as : SELECT * FROM `table`WHERE batchid IN ( 1, 2, 3, 5, 6 ) where the ( 1, 2, 3, 5, 6 ) is the $BatchIDs. Being new to php, I'm sure there is a cleaner way to do this. Thanks for all your help. I will be using php lots and have a lot of experience in Delphi which is WAY different than php, but I'll get it! - Adam -
[SOLVED] Processing a table of checkboxes / records.
nimzie replied to nimzie's topic in PHP Coding Help
Can you illustrate going through array results and creating a checkbox for each record in a loop? I'm having a hard time understanding how checkbox[] etc will all have unique values etc so I can loop through later... Thanks, Adam -
I'm pretty sure this is one of those skills people are using daily in the 'nix' side of things. My current O.S. is XP and I'm using MS Data Transformation services to try this. Is there another way to migrate from mssql05 -> Mysql? Any assist is much appreciated. - Adam