Jump to content

glendango

Members
  • Content count

    76
  • Joined

  • Last visited

Community Reputation

0 Neutral

About glendango

  • Rank
    Regular Member
  • Birthday 06/06/1976

Profile Information

  • Gender
    Male
  • Location
    England
  1. glendango

    xml php mysql

    Before i get slaughtered on stack i wanted to reask a question i cant get an answer to....sorry. XML Project. What is the pro way of handling xml data feed from a crm which i will eventually display the content on a searchable website….? Do you use simplexml or do you dump the ftp file into a database and then call what you need with php/html? Do you update a mysql database with a cron job / php script ? If so i want to overwrite the old data with the fresh data, is this possible? Why do we use simplexml? I ve tested it today and i like the way you can extract what you want from the .xml file ..so if its that good... Do I need a database at all if my script can display the raw xml without the need for a db..? What ive done so far is : Use simplexml on some basic files which worked fine but as soon I started using a ‘real’ xml file I coudnt get anything out of it.(currently asking feeder what is going on, waiting for answer) I cant find any straight advice on what pro devs do.. ive seen a lot on json as well which I like but all the crm houses still use xml feeds… Thanks in advance.
  2. glendango

    Replace database contents with xml file

    . iam sure what you said is correct.... all the other elements will only have 1 entry.. example : table 1 Properties bullet1 bullet2 bullet3..... bullet 10 they are predefined values put in by the user of the crm... Thanks.. DO i still have to manually put the fields in the table in by hand though? ii could have done it by now tbf but i wanted to see if more speedier way to set up the db..
  3. glendango

    Replace database contents with xml file

    that makes sense... so you might have many tables for an xml file with this many elements..i can feel a plugin coming on? in this case a table would be branches, properties, rooms, pictures, floorplans.. And do you have to name all the fields in the table by hand or can you use a 'flat file' ?? i find all the buzz words i just cant piece them together.
  4. glendango

    Replace database contents with xml file

    i read this yes...it tells me how to use it but doesnt tell me what is does... what does loadxml do? does it mean it creates the table column names automatically?
  5. Hi,,HAs anyone ever worked on .xml files with many elements in them. iam working on an xml project which i will eventually receive a feed from the xml provider , but having same issue understanding the process. I have a .xml practice file/doc and its for property on the market.. example below of content ( this is a practice file the feed provider releases to 'help' with set up..) <?xml version="1.0"?> -<agency name="Baxters Group" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> -<branches> -<branch name=" Baxters Bath"> -<properties> -<property reference="BB00000285"> <availableFrom/> <department>Agricultural</department> <propertyofweek>NO</propertyofweek> <price_text>OIRO £749,950</price_text> <numeric_price>749950.0000</numeric_price> <bedrooms>4</bedrooms> <receptions>2</receptions> <bathrooms>0</bathrooms> ----------------------- There are literally a 100 more elements to make up a complete a property... DO i actually have to manually create a field name for every element? This will take hours and i dont want to do this if the theory is incorrect . ALSO a house may have 10 photos or it may have 30 photos...how do i set up the schema to accomodate (pardon pun) all these different elements.. i would ask but nothing online goes back to basics..everything assumes the db schema knowledge is normally about 4 elements... i wish. i could just use a plug-in on wordpress but i want to learn this for more unsupported apps i might build. thanks
  6. glendango

    Rank for 1 User " You Are 995th at mysql in your town!"

    And i use 4.6.4 ...typical. where does it say its fixed? just some thread that goes nowhere when i read it. but thanks,,,do you think this is the issue?
  7. glendango

    Rank for 1 User " You Are 995th at mysql in your town!"

    only for testing purposes.. i think this is the issue as i get same errors. https://github.com/phpmyadmin/phpmyadmin/issues/12080
  8. i'am trying to get the users rank so i can display their rank in a div.. i.e you are 30 out of 400 users at getting sales. So far i ve managed to get the order of the users but thats it: i count the date_mades as sales made to get the totals. SELECT usr_id, count(date_made) as dater, @curRank := @curRank + 1 AS rank FROM firsts group BY usr_id order by dater desc gives me : usr_id dater rank 1 20 NULL 16 3 NULL 3 2 NULL 5 1 NULL 9 1 NULL 22 1 NULL 25 1 NULL i found this answer (Attached snippet) but i just get red crosses all over the statement when i try and run it: does anyone else get errors just pasting this into their phpmyadmin? is it a parser problem or syntax? SELECT pid, name, age, rank FROM (SELECT pid, name, age, @curRank := IF(@prevRank = age, @curRank, @incRank) AS rank, @incRank := @incRank + 1, @prevRank := age FROM players p, ( SELECT @curRank :=0, @prevRank := NULL, @incRank := 1 ) r ORDER BY age) s
  9. glendango

    Percentages

    Thanks as always for your time and answers. I will use that table for users to see the breakdown.. cool
  10. glendango

    Percentages

    i get it...its adding the values up and dividing them... what if i created a new status for the user which i called '2'. it wouldnt work then would it. i.e. in my case 0 = no sale 1= sale 2 = completed sale this works i think SELECT AVG(Status=1) FROM firsts where usr_id='1'
  11. glendango

    keeping users logged in.

    Sorry , just read this thread again ..thanks to all who responded. i used a meta refresh in the end so i know the user has gone back to the login page ..chrome does a good job of retaining the log in details so users can get straight back in.
  12. glendango

    Percentages

    what the.. ? how is that even working without telling mysql to count only the rows with '1' in them ?
  13. glendango

    Percentages

    Hi. Looking to get a % from my table(firsts) to give user stats.. I have : Date_made Status Date 1 0 Date 2 0 Date 3 1 Date 4 0 The answer will be 25% because their is 1 instance of '1' divided by 4 dates = 25% ( i know you can do sums so sorry for basic explain. ) i have tried below query and get an error but it best explains what iam trying to do: SELECT count(status) ,count(date_made) , status / date_made *100 from firsts where status = '1' i ve tried for a few hours but i just get back answer of 100 or 7x100 = 700 etc.. sorry i get back 700 in my real app becuase their are 7 instances of '1'
  14. glendango

    keeping users logged in.

    what does this site use to keep user logged in??? iam going to to take them back to log -in page after 10 minutes...
  15. glendango

    keeping users logged in.

    yep as always..looked at php.net and ended up 10x more confused.. i use the dateTime stamp to create the entry into the database and so dont control the 'time'. Does that make more sense? Do i change the ini or do i script it? Am i right about the godaddy part as well? this seems stupid seeing as they must have so many users in europe / uk .
×

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.