thx for your time but iam now equally confused.. Have you ever seen a search table / bar on a real estate property site?
it uses functions to query the database or the xml file with xpath.
where would you begin to search for these ready made functions ( granted i know i would have to fill in the gaps with my own data...
think of it more like this:
i want a hamburger.
I could make a hamburger ( function)
but macdonalds makes lots of ready made burgers..
so , iam looking for directions of how to get to macdonalds..... to eat..... a burger / function....

I have been teaching myself xml manipulation as well as db queries to create a detailed search engine for users ( a bit like rightmove uses to search through property and allow user to change e.g.. how many bedrooms or status of sold or available..
I could keep on this path for another few weeks but i cant help thinking there must be php function library that will basically give me the scripts i need to set up a real estate website with all the functions i need for searching property ..
i dont mean wordpress either.... this is terrible experience and trying to glue the xml feeds into a parser and into a blog without some of the data being lost is annoying.
i started using laravel a few weeks ago and with 1 line of code a login system was created using COMPOSER...
i thought this would be great..but on visiting composer i cant make head or tail of their search bar to even find what i'am looking for on the composer site.
Does what i'am looking for exist ?
The site iam was hoping to find was:
www. here you go, all the code you need to make a modern web site in 2018 , all divided into handy folders and clear explanations of what they do .com
so far i havent found anything that comes close....
cheers.

'Do you realise that the code you posted does not execute any queries?'
ha yes,,i print onto screen .. otherwise i would be up to about 5000 unique id's if kept sending it to db while i sort this code out.
i cant get my head round your example! where does it go in relation to my code. come on...iam so close.

maybe that was lost in translation.. yes i have a primary key for every image. = picture_id in my case. So i have 3 columns in the pictures table.
So, how to get many pictures belonging to each product into the table with the same property_id . Any chance you could could edit my example..cant follow your foreach example.

Happy Thursday ! I will try to ruin it for you.
I have an xml file with products in it and i use xpath to get out what i need from the file.
Nested in each product are all the elements = $variables below. i need the pictures of which there may be upto 20 in each product to go into a seperate mysql table because its relational. but have the same id as the property table.
i have managed to get the first picture to behave this way by using Last_insert_id . What i cant do is get the remaining pictures->picture->filename (nested) ; to insert into the table with the corresponding property id (which i auto increment)
the filename holds the text url (not a blob) which i store and will echo once i start doing my select statements.
Hope this is clear enough.... thx
$xml = simplexml_load_file('propertiesshort.xml') or die("can not find it");
foreach($xml->branches->branch->properties->property as $row){
$instructedDate = (string)$row->instructedDate;
$price_text = (string)$row->numeric_price;
$bedrooms = (int)$row->bedrooms;
$priority =(string)$row->priority;
$advert_heading = (string)$row->advert_heading;
$brochure = (string)$row->brochure;
foreach($xml->branches->branch->properties->property->pictures as $rows ){
$pictures = (string)$rows->picture->filename;
$sql = "INSERT INTO properties( instructedDate, price_text, bedrooms, priority, advert_heading, brochure) VALUES ('". $instructedDate ."','". $price_text ."','". $bedrooms ."','". $priority ."','". $advert_heading ."','". $brochure ."')";
$sql2 = "INSERT INTO pictures(property_id, filename) VALUES (LAST_INSERT_ID(),'". $pictures ."')";
print_r($sql);
echo"<br><br>",
print_r($sql2);
echo"<br><br>";
?>

great thanks... you actually answered all my questions you couldnt understand at the end with your other answers..
SO
database is better to store
use simplexml to get the xml and then use php to insert the xml into a database..( a cron job can be set up to do this automatically)
Sounds simple out loud but you would be amazed how hard it is to get this method confirmed as the correct way to do something...
Even in massive big php books xml only gets about 1 page.....
i suppose i didnt get answer onn how you put all the elements into the database , but iam guessing this is done by hand.... like this example...
foreach ($xml->children() as $row) {
$title = $row->title;
$link = $row->link;
$description = $row->description;
$keywords = $row->keywords;
$sql = "INSERT INTO

many thanks... so what is simplexml for ? i thought the database option was most logical but got thrown by the use of this tool .
also when it comes to insert/update the database , would i set up a php statement for every element of a property (there are 4 fileds (tables) and over 50 eleements.
Do you hand write in every element to the code and the table titles? i dont mind doing this as once its done once thats it.. but interested in the logic of xml to database to website....
nb.. is simplexml used to display basic information from an rss / api type feed... ? you put the xml into a database when you need more control over data?

1) Feed comes from a CRM which is a third party. I will be creating a website that uses the feed to display over 100 products from the feed.
2) The feed is updated every 1 hour.
3) The data is property for estate agents..so basically a web site for an estate agents.
There are plugins for this on wordpress but i dont want to use them as i want full control of the data.
hope this helps...

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.

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

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.