Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Multiple update queries?
Old 09-15-2007, 12:46 PM Multiple update queries?
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Im guessing you can't do this in PHP/MySQL?

PHP Code:
$sql=mysql_query("UPDATE profile SET (name, heightft, heightin, bust, waist, hip,
hair, eye, location, age, shoe, dress, special) 
VALUES ('
$_POST[name]', '$_POST[heightft]', '$_POST[heightin]', '$_POST[bust]', 
'
$_POST[waist]', '$_POST[hip]', '$_POST[hair]', '$_POST[eye]', '$_POST[location]', '$_POST[age]', '$_POST[shoe]', '$_POST[dress]', '$_POST[special]') where name='$_POST[model]'"); 
Would I need to update each field with its own update query or something?
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 09-15-2007, 09:18 PM Re: Multiple update queries?
Experienced Talker

Posts: 44
Name: Kuldeep Sahi
Trades: 0
You can have a single update query, but the syntax is this way:

PHP Code:
$sql=mysql_query("
UPDATE 
    profile 
SET 
name='
$_POST[name]',
heightft='
$_POST[heightft]',
heightin='
$_POST[heightin]',
bust='
$_POST[bust]',
waist='
$_POST[waist]',
hip = '
$_POST[hip]',
hair='
$_POST[hair]',
eye='
$_POST[eye]',
location='
$_POST[location]',
age='
$_POST[age]',
shoe='
$_POST[shoe]',
dress='
$_POST[dress]',
special'
$_POST[special]') 
where name='
$_POST[model]'"); 
__________________

Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
,
Please login or register to view this content. Registration is FREE
Kuldeep2195 is offline
Reply With Quote
View Public Profile Visit Kuldeep2195's homepage!
 
Old 09-15-2007, 10:38 PM Re: Multiple update queries?
goheadtry's Avatar
Webmaster Talker

Posts: 730
Name: John
Location: United States of America, California
Trades: 0
Only if they are the same table that will work
Quote:
Originally Posted by Kuldeep2195 View Post
You can have a single update query, but the syntax is this way:

PHP Code:
$sql=mysql_query("
UPDATE 
    profile 
SET 
name='
$_POST[name]',
heightft='
$_POST[heightft]',
heightin='
$_POST[heightin]',
bust='
$_POST[bust]',
waist='
$_POST[waist]',
hip = '
$_POST[hip]',
hair='
$_POST[hair]',
eye='
$_POST[eye]',
location='
$_POST[location]',
age='
$_POST[age]',
shoe='
$_POST[shoe]',
dress='
$_POST[dress]',
special'
$_POST[special]') 
where name='
$_POST[model]'"); 
__________________
Free $1 gift card when you signup at
Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

goheadtry is offline
Reply With Quote
View Public Profile Visit goheadtry's homepage!
 
Old 09-16-2007, 06:54 AM Re: Multiple update queries?
pealo86's Avatar
Super Spam Talker

Posts: 876
Name: Matt Pealing
Location: England, north west
Trades: 0
Ahhhh I seeeeeeeee!

Thanks to both, yea the table is the same
__________________

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Reply     « Reply to Multiple update queries?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off





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



Page generated in 0.16140 seconds with 12 queries