Jump to content
Sign in to follow this  

need help with comparing values while parsing an xml file

Recommended Posts

i am getting the result correctly entered in the db with this code. unfortunately i need the data that enters the db changed a little.  

i want when the value of  $value->CategoryParentID  is equal to the $value->CategoryID  0 be entered instead of $value->CategoryParentID.

$results = new SimpleXMLElement($responseXml); }
					if ($results->Ack == "Success")
							tep_db_query("truncate table ebay_categories_description");
							tep_db_query("truncate table ebay_categories");
							$c = 0;
							foreach ($results->CategoryArray->Category as $key => $value)
///// i need to find out if the two values are equal here 
									tep_db_query("insert into ebay_categories (categories_id, parent_id) values (" . $value->CategoryID . ", " . $value->CategoryParentID .")");

tep_db_query("insert into ebay_categories_description (categories_id,  categories_name) values (" . $value->CategoryID . ", '"  . addslashes($value->CategoryName) . "')");
								} //$results->CategoryArray->Category as $key => $value
							echo $c . " categories inserted successfully!<br>";
						} //$results->Ack == "Success"
							echo "get categories error<br>";

but when i use an if statement it breaks the process

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • 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.