[advanced search]
 

Go Back   NamePros.com > Discussion > Web Design & Development > Programming

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.


Closed Thread
 
LinkBack Thread Tools
Old 12-14-2005, 10:07 AM   #1 (permalink)
NamePros Regular
 
Join Date: Feb 2004
Posts: 631
57.15 NP$ (Donate)

teclance is on a distinguished road


mysql statement help

Hey,

I am running OSC and I need to issue a MYSQl statement to the effect of:

products_model = products_id ONLY if the products_model field is blank.

In other words, if there is ALREADY a product model, it should be left alone. If there is NOT one already then it should be set to the products_id.

Does any one have a suggestion of how to do this?


thanks a bunch
__________________
Sincerely
Mike Kelly
teclance is offline  
Old 12-14-2005, 10:11 AM   #2 (permalink)
sjp
NamePros Member
 
sjp's Avatar
 
Join Date: Oct 2005
Location: Andromeda
Posts: 136
369.50 NP$ (Donate)

sjp is on a distinguished road


update table_name set products_model = products_id where products_model is null

or depending on what you consider blank

update table_name set products_model = products_id where products_model = ''
sjp is offline  
Old 12-14-2005, 10:22 AM   #3 (permalink)
NamePros Regular
 
Join Date: Feb 2004
Posts: 631
57.15 NP$ (Donate)

teclance is on a distinguished road


thanks a bunch for that I will give it a shot.
__________________
Sincerely
Mike Kelly
teclance is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: Install the Apache Web Server, Perl, PHP, and MySQL on Windows deadserious Webmaster Tutorials 96 05-27-2007 01:24 PM
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
MySQL Tips shahid_146 Webmaster Tutorials 4 10-18-2005 12:53 PM
Tutorial: How to Install Apache2 MySQL and PHP on Windows deadserious Webmaster Tutorials 35 09-21-2005 09:46 PM
Tutorial: Getting Started With MySQL (The Basics) deadserious Webmaster Tutorials 3 04-18-2004 01:17 PM

Site Sponsors
Advertise your business at NamePros

All times are GMT -7. The time now is 07:56 AM.


Powered by: vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
Template-Modifications by TMS
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85