Hi when execute this query <?php $sqlr ="select * from biblioitems where EXTRACTVALUE( marcxml, \ '//datafield[@tag="520"]/subfield[@code="d"]')='' "; give me this error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\ "//datafield[@tag="520"]/subfield[@code="d"]")=""' at line 4 any help??
Try: $sqlr ="select * from biblioitems where EXTRACTVALUE( marcxml, '//datafield[@tag=\"520\"]/subfield[@code=\"d\"]')='' "; Code (markup): Basically remove the escape string for single quote which I don't see it needed, and add the needed escape for quotes.
One thing I noticed immediately was this marcxml, \ '// <----- This appears to me that you were trying to pass the single quote by putting the \ in front of it. Yet near the end you had "d"]')='' "; <------ Here you have the what appears to be ending single quote and there is no \ In this statement you should try EXTRACTVALUE( marcxml, ''//datafield[@tag="520"]/subfield[@code=\"d\"]'')='' "; Thats my guess on this.