Reply
insert into sql
Old 01-12-2005, 10:56 AM insert into sql
Experienced Talker

Posts: 32
i want to replace all blankspaces in the Title field in my database with  .

so for example if the title is 12 days - i would like to change it to 12 days

is there any easy way of doing this?

thanks
hershel is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 01-12-2005, 11:13 AM
Republikin's Avatar
Super Moderator

Posts: 3,191
PHP Code:
preg_replace(' '' '$title); 
Republikin is offline
Reply With Quote
View Public Profile
 
Old 01-13-2005, 02:05 AM
JasonMichael's Avatar
Novice Talker

Posts: 13
I didn't know preg_replace would work that way, without a REGX pattern. Cool. He could also do:

PHP Code:
$title=str_replace(' ',' ',$title); 
__________________
Visit www.JMRTechnet.com - PHP Tutorials and More! Home Business Directory
JasonMichael is offline
Reply With Quote
View Public Profile
 
Old 01-13-2005, 06:09 AM
Experienced Talker

Posts: 32
I have tried this but get the response:

#1064 - 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 '$Title=str_replace(' ',' ',$Title)' at line 1
.

I am using phpmyadmin 2.6.1 for my sql commands
hershel is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to insert into sql
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14562 seconds with 12 queries