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
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.