Well, hours of trying are not hours wasted: they are hours of learning. 8 hours…1 day…1 week… learning time is always valid. Which part do you have problems with? What type of data does your PHP script return? Json? What’s actually going on in your web . got? Give more details and that increases the chance that you will receive help directed to your problem.
Hugs