|
-
May 24th, 2010, 11:36 AM
#1
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|