Results 1 to 2 of 2

Thread: Using str_replace

  1. #1
    Join Date
    Jul 2007
    Location
    Johor Bahru
    Posts
    200
    Rep Power
    154

    Using str_replace

    Hi, I am wondering why the following codes doesn't work for me: $pt_new=str_replace("%27", "'", $pt_old);

    I also tried $pt=str_replace("%27", "/'/", $pt);

    When I tried to access a page with the title, "Zainal Abidin A'ala", I get 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 'ala'' at line 1"

    with $result = mysql_query("SELECT page_title, page_len FROM $page WHERE page_namespace='$ns' AND page_title='$pt'") or die(mysql_error());

  2. #2
    Join Date
    May 2019
    Location
    Ahemdabad
    Posts
    20
    Rep Power
    0
    Try this script

    var myStr = 'this,is,a,test';
    var newStr = myStr.replace(/,/g, '-');

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Search Engine Optimization by vBSEO 3.5.0 RC1 PL1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47