Forum Moderators: coopster
this works
$non_sef_url_old = 'id=2537';
$database->setQuery("SELECT id, introtext FROM #__content WHERE introtext LIKE '%".$non_sef_url_old."%' ");
$non_sef_url_old = 'index.php?option=com_content&view=article&id=2537:test-content&catid=39:news&Itemid=70';
$database->setQuery("SELECT id, introtext FROM #__content WHERE introtext LIKE '%".$non_sef_url_old."%' ");
What am I overlooking?
&
When you query a database, it resolves to the browser as &, even in form fields. If you apply htmlentities to a value before inserting you can get
&
I'll suggest something else, storing a big query string like this is going to give you many many headaches. Instead of
index.php?option=com_content&view=article&id=2537:test-content&catid=39:news&Itemid=70
consider
rec_id¦script...¦option.....¦action.¦art_id¦cat¦item
1.....¦index.php¦com_content¦article¦2537..¦39 ¦70
or something. It may be a hassle to set up, but would be far easier to manage and less of a burden on your database.
When you say exact, are you sure?
considerrec_id¦script...¦option.....¦action.¦art_id¦cat¦item
1.....¦index.php¦com_content¦article¦2537..¦39 ¦70
Thanks for reply.