Php select ExtractValue

when execute this query
$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??

You have " " nested inside ’ ’ nested inside " "

The first " of that nested " " terminates the outermost "

You need to escape quotes when you use them inside quotes of the same type even if a different type of quotes is in between.

1 Like

thanks solved and this solution

"select *
from biblioitems
where EXTRACTVALUE( marcxml, ‘//datafield[@tag="520"]/subfield[@code="d"]’)=‘’ "

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.