CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2005
    Location
    San Antonio Tx
    Posts
    44

    Warning: mysql_result(): supplied argument is not a valid MySQL result

    im getting Warning: mysql_result(): supplied argument is not a valid MySQL result resource in when using str_replace, im trying to replace a all "-" characters with " " on a string

    im pulling the original string form mysql database and it on this format "this-is-an-example-of-a-phrase" and i just want to make it "this is an example of a phrase" and im using this code :

    Code:
    $TitleWithSpaces = str_replace("-", " ", $queryGetTitle);
    echo mysql_result($TitleWithSpaces,0);
    if i use the query directly without replacing the dashes it works just fine but when trying to replace characters it wont work, im trying to understand why this happends.

    i would apreciate any help thanks.

    *UPDATE*
    found a way around it, i replaced the dashes with the replace function of mysql so in other words i did it at the time of the query which is i guess a better practice than trying to use php to do this
    Last edited by mrjavoman; May 24th, 2010 at 11:56 AM. Reason: found answer

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Warning: mysql_result(): supplied argument is not a valid MySQL result

    The reason it wouldn't work as you have showed is because you're not using the actual MySQL returned variable.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured