Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    39
    Thanks
    4
    Thanked 0 Times in 0 Posts

    I cannot get this STR_REPLACE to work

    How do I modify the Mysql query string in PHP for the following
    str_replace function?
    I don't know how to do it.

    $query = str_replace("WHERE","WHERE prospectid > \"$prospectID\" AND",$query);

  • #2
    New Coder
    Join Date
    Apr 2006
    Location
    Tadley, UK
    Posts
    63
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hmm, Not sure why it might not work, unless the variables are colliding.
    PHP Code:
    $query1 str_replace("WHERE""WHERE `prospectid` > {$prospectID} AND"$query); 
    let me know if you are having any more problems!

    The only other thing I can think of is the case of the text, in which case use str_ireplace (case insesitive version).


  •  

    Posting Permissions

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