nade93
Members-
Posts
113 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
nade93's Achievements
Member (2/5)
0
Reputation
-
Trying to group an xml array by attribute and pir
nade93 replied to nade93's topic in PHP Coding Help
$xml = simplexml_load_file('http://cachepricefeeds.williamhill.com/openbet_cdn?action=template&template=getHierarchyByMarketType&classId=1&marketSort=--&filterBIR=Y'); $x = $xml->response->williamhill->class->type; foreach ($x as $p=>$t): // get the type for drill down to market ?> <div id='feedhead'><? echo $t['name']; ?></div> <? foreach ($t as $m): // get the attributes for the market //-------- GET THE DATES IN ORDER $d = explode('-', $m['date']); $date = $d[2].'/'.$d[1].'/'.$d[0]; echo $m['url']; endforeach; endforeach; -
Trying to group an xml array by attribute and pir
nade93 replied to nade93's topic in PHP Coding Help
thanks for the replay however When I implement that no results (inluding the header) pull at all -
hi all I am trying to get one printed result from an attribute that is pulling from a nested array I am pulling a top layer for the header then placing the items under the header foreach ($x as $p=>$t): // get the type for drill down to market ?> <div id='feedhead'><? echo $t['name']; ?></div> <? foreach ($t as $m): so the $m['url'] is the thing i am wanting to group by as is it pulling things that are duplicating. so if did below for example echo $m['url'].'<br>'; would output as http://google.com http://google.com http://google.com http://google.com however would want just the single output from the loop http://google.com how do i go about this? thanks in advance
-
Hi all I am hoping you can help. I am looking to pull the feed and parse the follow. I am wanting to get both the attributes and the cildren of the market branch of xml. Can someone help me out please? <oxip version="7.1" created="2014-03-21 19:19:20" lastMsgId="" requestTime="0.1686"> <response request="getHierarchyByMarketType" code="001" message="success" debug=""> <williamhill> <class id="436" name="Football - Virtual" maxRepDate="2014-03-21" maxRepTime="00:56:39"> <type id="8398" name="Victoria Stadium" url="http://sports.williamhill.com/bet/betting/t/8398" lastUpdateDate="2014-03-10" lastUpdateTime="23:31:52"> <market id="152656333" name=" Czech Republic v Poland - Match Betting" url="http://sports.williamhill.com/bet/en-gb/betting/e/5778703/%2dCzech%2dRepublic%2dv%2dPoland"date="2014-03-21" time="19:20:00" betTillDate="2014-03-21" betTillTime="19:20:00" lastUpdateDate="2014-03-21" lastUpdateTime="00:53:59"> <participant name="Poland" id="534674127" odds="2/1" oddsDecimal="3.00" lastUpdateDate="2014-03-21" lastUpdateTime="00:53:59" handicap=""/> <participant name="Draw" id="534674126" odds="12/5" oddsDecimal="3.40" lastUpdateDate="2014-03-21" lastUpdateTime="00:53:59" handicap=""/> <participant name="Czech Republic" id="534674125" odds="5/4" oddsDecimal="2.25" lastUpdateDate="2014-03-21" lastUpdateTime="00:53:59" handicap=""/> </market>
-
hi ken its all in the text really basically there is a directory listing with 6 preferential listings running off a different script that are sorted into the members_categories_position table. However I do not want the listing to be duplicated, so need to check if the member user exists in the members_categories_position table, if it does it needs to exclude them from the listings
-
hmm still struggling with this after three hours! where am i going wrong??? any help would be amazing please
-
Hi All i hope someone can help about to scream! basically I am trying to do a few things with the statement below; First i want to check if the user id exists in member_categories_position. If it Does i want then to exclude all entries from the second statement where member_id equals all results from the first statement the third statement is the else statement that displays if the member_id is not present in the member_categories position. PROBLEM - the result from the first system loops fine, however when i try and insert into the second statement (!='$memid') is produces no results and has no effect. I think the problem is that $memid is a looped result. How do i get the second statement to say that any member_id that is in member_categories_position will not show in that statement? $sql2 = "SELECT * FROM member_categories_position a JOIN member_users b ON b.id = a.member_id"; $rs2 = mysql_query($sql2); while ($row = mysql_fetch_array($rs2)){ $memid = "".$row['member_id'].""; } if(mysql_num_rows($rs2) != 0){ $new= "SELECT * FROM member_categories JOIN member_users on member_categories.member_id=member_users.id JOIN member_config on member_categories.member_id=member_config.member_id WHERE member_categories.categories='$category' and member_categories.member_id !='$field' group by member_config.member_id order by RAND() limit 0,42"; $rs = mysql_query($new); while ($row = mysql_fetch_assoc($rs)) { echo "result excluding member ids from the first statement"; } echo "<div class=\"clear\"></div>"; } else{ $new= "SELECT * FROM member_categories JOIN member_users on member_categories.member_id=member_users.id JOIN member_config on member_categories.member_id=member_config.member_id WHERE member_categories.categories='$category' group by member_config.member_id order by RAND() limit 0,42"; $rs = mysql_query($new); while ($row = mysql_fetch_assoc($rs)) { echo "Result with all member ids"; } echo "<div class=\"clear\"></div>"; }}
-
hi above is the latest code as reverted back when all others seems to break the login system totally i know its a session manipulation but apart from that i am stuck!
-
oh dear been at this for few hours now and still no further, anyone who can help would be my hero
-
Hi All I am using the following method to check if user is logged in to a member area. However, I ahve a password change section that then redirects back the the password change page within the logged in area. After password changes it automatically redirects back to the index page rather than password page and comes up with a redirect error (too many redirects) How can i change the code to match the new change in password. I think its a sessions problem but not great with sessions! if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM member_users WHERE email = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { $usernameid=$info['username']; $userid = $info['id']; $firstname = $info['fname']; $lastname = $info['lname']; //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']) { header("Location: index.php"); } //otherwise they are shown the admin area else { echo "<div class=\"memberloginactive\">Welcome $firstname | Your Profile | <a href=\"edit-profile.php?id=$userid\">Edit Profile</a> | <a href=\"logout.php\">Logout</a></div><div class=\"clear\"></div>"; } } } else {
-
i had them saves in CYMK rather than RGB jpegs
-
Hi All take a look at http://www.buypromo.co.uk/index.php in IE 7 or 8 the images at the bottom of the page are not showing up, whereas therest are find, any ideas? thanks
-
php sort mysql results into three columns and sort by parent
nade93 replied to nade93's topic in PHP Coding Help
that wouldnt put it in columns, nor would it group the content by the parent in order to split to columns thanks -
php sort mysql results into three columns and sort by parent
nade93 replied to nade93's topic in PHP Coding Help
all from these previous listings from internet. the top one almost does what i need, however cannot get it to work http://stackoverflow.com/questions/3323626/help-on-displaying-data-in-colunm-php-mysql-modified-preorder-tree-trasversal http://www.codingforums.com/archive/index.php/t-165642.html -
Hi All i am wanting a column list like this http://extensions.joomla.org/extensions basically the database is set up as (id, category, parent) I want the parent to group the category section and list like the the joomla example in three columns search various threads throughout the internet but none seem to cover this entirely can any one please help?????