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
Old 06-30-2010, 05:18 PM MySql UPDATE issue
Junior Talker

Posts: 1
Name: Charles Lyle LaRue
Trades: 0
Hi,

I'm trying to update a table based on input from a previous page's form. The update page gets the form variables from $_POST and assigns them to $lastname, $firstname, etc.

The page echoes these variables correctly, so I know they are being passed from the form page correctly, but the table never gets updated, so I think there's something wrong with my UPDATE statement's syntax. What am I missing?


Code:
$query = "UPDATE 2010JVSummerRoster SET `lastname`='.$lastname.',`firstname`='.$firstname.',`homephone`='.$homephone.',`cellphone`='.$cellphone.',`year`='.$year.',`position`='.$position.',`number`='.$number.' WHERE `id`='.$id.'";
mysql_query($query);
Thanks!
HypnoToad is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-30-2010, 05:28 PM Re: MySql UPDATE issue
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
echo the sql statement after concatenation to the screen and check it for errors
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-02-2010, 07:55 AM Re: MySql UPDATE issue
Experienced Talker

Posts: 41
Trades: 0
$query = mysql_query("Update table_name SET column_name1='$_POST[field_value1]' ,
column_name2='$_POST[field_value2]'
where column_name= $Required_value",$connect);
sandeep Kumar is offline
Reply With Quote
View Public Profile Visit sandeep Kumar's homepage!
 
Reply     « Reply to MySql UPDATE issue
 

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.16234 seconds with 12 queries