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
Need Help with updating mysql from php
Old 03-02-2010, 05:18 AM Need Help with updating mysql from php
Novice Talker

Posts: 8
Trades: 0
i want to update my sql many times and for that i am creating a script.
i created a from with things that need to be updated.
i tried this coding:

PHP Code:
$f=mysql_db_query("database_name","SELECT runs FROM table_name WHERE player=$_POST[name]");mysql_db_query("database_name","UPDATE table_name SET runs=$f+$_POST[runs] WHERE player=$_POST[name]"); 
when i use this runs are updated but the are not added with previous data.
actually i have problem with SELECT as well
like if:
runs=1
$_POST[runs]=5
updated runs=5
can anyone help?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
bodyboard662 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-02-2010, 07:17 AM Re: Need Help with updating mysql from php
Mad182's Avatar
Skilled Talker

Posts: 54
Name: Madars
Location: Latvia
Trades: 0
Code:
UPDATE table_name SET runs=runs+".intval($_POST['runs'])."
__________________
There's no place like 127.0.0.1

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
Mad182 is offline
Reply With Quote
View Public Profile Visit Mad182's homepage!
 
Old 03-03-2010, 06:00 AM Re: Need Help with updating mysql from php
Novice Talker

Posts: 9
Trades: 0
PHP Code:
mysql_db_query("database_name","UPDATE table_name SET runs=runs+$_POST[runs] WHERE player=$_POST[name]"); 
__________________
<><><><><><>
giclee12 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Need Help with updating mysql from php
 

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