Business Advice and Help Forum for Businesses or Starting a Company in the UK - A1 Business Forums
corner image corner image
Member Box




corner image corner image
Our Advertisers

corner image corner image
Register FAQ Members List Today's Posts Search Today's Posts Mark Forums Read
A1 Business Blog Home
corner image corner image
A1businessforums.co.uk - The UK's Friendliest Online Business Community
Go Back   Business Forum UK - Advice Help and Questions - A1 Forums > Business Forums > IT, Internet, Web Hosting and Communications
Reload this Page

Adding coding in to default value of MySQL field?

For Computers and Software, Servers and Networking, Internet Service Providers, Web Hosts and Telecommunications

Reply
Page 1 of 2 1 2 >
corner image corner image
 
LinkBack Thread Tools Display Modes

corner image corner image
  #1 (permalink)  
Old 29-07-2008, 14:05
UKSBD UKSBD is offline
A1 is my Second Home!
 
Join Date: Mar 2008
Location: Warwickshire
Posts: 354
Thanks: 2
Thanked 65 Times in 52 Posts
Default Adding coding in to default value of MySQL field?

Does anyone know how to add coding as a default value in a MySQL field?

I am trying to set a default value of an existing field, but the default value
I want to add is coding that includes * "" and !

I am using,
UPDATE `tbl_test` SET `newfield` = 'default value'

it works fine if the default value is plain text, but if I try to add the coding
as the default value, the last quotation mark gets removed resulting in an error.

Any help appreciated.

Just to add.
The site is in .ASP (php enabled) and I am trying to do it via phpmyadmin
__________________
UK Small Business Directory

A hen is for Christmas - Order now while stock lasts.

Last edited by UKSBD; 29-07-2008 at 14:06. Reason: adding a bit more info
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
corner image corner image
Sponsored Links

Register to remove these ads
UKSBD
View Public Profile
Send a private message to UKSBD
Visit UKSBD's homepage!
Find all posts by UKSBD
corner image corner image
  #2 (permalink)  
Old 29-07-2008, 14:38
Jeewhizz's Avatar
Jeewhizz Jeewhizz is offline
Blog Entry: Act like a professional
Resident Forum Monkey
 
Join Date: Feb 2008
Location: Small village near Peterborough
Posts: 2,482
Thanks: 142
Thanked 565 Times in 458 Posts
What's the exact string you are entering?
__________________
Hi, I'm Khalid who runs Pixelcraze, a web development agency based near Peterborough. Please contact us for a quote.

Our Brands: URL.co.uk | Airport Car Parking
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
Jeewhizz
View Public Profile
Send a private message to Jeewhizz
Visit Jeewhizz's homepage!
Find all posts by Jeewhizz
corner image corner image
  #3 (permalink)  
Old 29-07-2008, 15:55
UKSBD UKSBD is offline
A1 is my Second Home!
 
Join Date: Mar 2008
Location: Warwickshire
Posts: 354
Thanks: 2
Thanked 65 Times in 52 Posts
Thanks,

It is AdSense code like this

<script type="text/javascript"><!--
google_ad_client = "pub-000";
/* 468x60, created 7/28/08 */
google_ad_slot = "00000000";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

and has to remain exactly the same, spread over the 11 lines
when I add it as the default value between the ' ' the 2nd ' gets deleted
when running the query
__________________
UK Small Business Directory

A hen is for Christmas - Order now while stock lasts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
UKSBD
View Public Profile
Send a private message to UKSBD
Visit UKSBD's homepage!
Find all posts by UKSBD
corner image corner image
  #4 (permalink)  
Old 29-07-2008, 17:06
dragonfly dragonfly is offline
A1 is my Second Home!
 
Join Date: Jul 2008
Posts: 174
Thanks: 7
Thanked 12 Times in 6 Posts
Try enclosing it in " quotation marks, and changing the ones in the code to ' quote ation marks. i.e. change the javascript to single quotes etc. then enclose the whole lot in "
__________________
Same Day Courier
I want to give you MONEY
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
dragonfly
View Public Profile
Send a private message to dragonfly
Find all posts by dragonfly
corner image corner image
  #5 (permalink)  
Old 29-07-2008, 17:31
yorkshiresource yorkshiresource is offline
UKSBF Convert
 
Join Date: May 2008
Posts: 11
Thanks: 2
Thanked 7 Times in 3 Posts
just tested this and it worked okay for me (via phpmyadmin). What type is the field you're trying to update ie text/varchar? If varchar, is it possible that the code string is longer than the maximum number of characters?

Also, is phpmyadmin throwing an error, or is it just that part of the code isn't being stored?
__________________
Yorkshire Business Directory
Yorkshiresource


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
yorkshiresource
View Public Profile
Send a private message to yorkshiresource
Visit yorkshiresource's homepage!
Find all posts by yorkshiresource
corner image corner image
  #6 (permalink)  
Old 29-07-2008, 18:38
UKSBD UKSBD is offline
A1 is my Second Home!
 
Join Date: Mar 2008
Location: Warwickshire
Posts: 354
Thanks: 2
Thanked 65 Times in 52 Posts
Thanks all,

I have gotten around it by replacing the double quotes in the adsense code " with 2 single quotes ''
__________________
UK Small Business Directory

A hen is for Christmas - Order now while stock lasts.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
UKSBD
View Public Profile
Send a private message to UKSBD
Visit UKSBD's homepage!
Find all posts by UKSBD
corner image corner image
  #7 (permalink)  
Old 30-07-2008, 07:29
dragonfly dragonfly is offline
A1 is my Second Home!
 
Join Date: Jul 2008
Posts: 174
Thanks: 7
Thanked 12 Times in 6 Posts
Quote:
Originally Posted by UKSBD View Post
Thanks all,

I have gotten around it by replacing the double quotes in the adsense code " with 2 single quotes ''
If you mean ''Javascript'' instead of "Javascript" I'm not sure that will work as code, should be 'javascript'
__________________
Same Day Courier
I want to give you MONEY
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
dragonfly
View Public Profile
Send a private message to dragonfly
Find all posts by dragonfly
corner image corner image
  #8 (permalink)  
Old 30-07-2008, 08:29
openmind's Avatar
openmind openmind is offline
Blog Entry: We will remember them?
Resident Server Geek
 
Join Date: Mar 2008
Location: In front of my computer...
Posts: 1,775
Thanks: 110
Thanked 339 Times in 256 Posts
Quote:
Originally Posted by dragonfly View Post
If you mean ''Javascript'' instead of "Javascript" I'm not sure that will work as code, should be 'javascript'
It should work with either " or '
__________________
Cheers, Phil

Are you Webbylisted? If not you should be...

eCommerce Software, UK Web Hosting, Dedicated Servers, Domain Names
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
openmind
View Public Profile
Send a private message to openmind
Visit openmind's homepage!
Find all posts by openmind
corner image corner image
  #9 (permalink)  
Old 30-07-2008, 09:12
UKSBD UKSBD is offline
A1 is my Second Home!
 
Join Date: Mar 2008
Location: Warwickshire
Posts: 354
Thanks: 2
Thanked 65 Times in 52 Posts
Quote:
Originally Posted by dragonfly View Post
If you mean ''Javascript'' instead of "Javascript" I'm not sure that will work as code, should be 'javascript'
When it is added to the database one of the single quotation marks gets
dropped, so the code generated on the page changes from
''javascipt'' to 'javascript'
__________________
UK Small Business Directory

A hen is for Christmas - Order now while stock lasts.

Last edited by UKSBD; 30-07-2008 at 09:50. Reason: changed it from "pulled from the database" to "added to the database"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
UKSBD
View Public Profile
Send a private message to UKSBD
Visit UKSBD's homepage!
Find all posts by UKSBD
corner image corner image
  #10 (permalink)  
Old 30-07-2008, 13:07
dragonfly dragonfly is offline
A1 is my Second Home!
 
Join Date: Jul 2008
Posts: 174
Thanks: 7
Thanked 12 Times in 6 Posts
Ahh that makes sense then, yes that should work. Not sure it's 100% correct way of doing it but the end result sounds the same
__________________
Same Day Courier
I want to give you MONEY
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookStumble this Post!Google Bookmark this Post!
Reply With Quote
dragonfly
View Public Profile
Send a private message to dragonfly
Find all posts by dragonfly
Reply
Page 1 of 2 1 2 >

« Blumming Flash! | XC Cube as a server »

corner image corner image
Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode
Hybrid Mode Switch to Hybrid Mode
Threaded Mode Switch to Threaded Mode

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

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

corner image corner image
Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL on a Windows server Case IT, Internet, Web Hosting and Communications 2 14-07-2008 14:44
Adding landing pages Case SEO Advice and Help for Search Engine Optimisation 9 09-07-2008 15:58
Coding - what do you .... sally Graphic Design, Web Design and Coding 15 19-05-2008 12:21
Biography field Peter W Feedback and Help 3 11-05-2008 19:42
Paypal Issues - Adding on VAT automatically! deviltronics E-Commerce, Shopping Carts and Payment Processors 2 04-04-2008 13:07


All times are GMT. The time now is 00:24.


Calendar - Contact Us - A1 Business Forum UK - Archive - Top

© A1 Business Forums 2008

A1 Business Forums is a brand of Pixel Mind Ltd, a company registered in England and Wales with company number 06693709

Pixelcraze
Forum theme a Pixelcraze Creation





LinkBack
LinkBack URL LinkBack URL
About LinkBacks About LinkBacks
Bookmark & Share
Digg this Thread! Digg this Thread!
Add Thread to del.icio.us Add Thread to del.icio.us
Bookmark in Technorati Bookmark in Technorati
Furl this Thread! Furl this Thread!
Share on Facebook Share on Facebook
Stumble this Thread Stumble this Thread
Google Bookmark this Thread Google Bookmark this Thread