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
where is my mistake ? (mysql_query)
Old 10-20-2010, 12:06 AM where is my mistake ? (mysql_query)
ZoC
Skilled Talker

Posts: 68
Trades: 0
can someone tell me where i mistake ...

PHP Code:
   $trafficUp       $trafficResult['in']+1;
   
$trafficId       $trafficResult['Id'];
   
mysql_query("UPDATE trafficEx SET in = '$trafficUp' WHERE id = '$trafficId'"); 
is not update my table ...
703b17d5-3b5d-412a-93cb-be1181dbc27e
1.03.01
ZoC is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-20-2010, 05:44 AM Re: where is my mistake ? (mysql_query)
Skilled Talker

Posts: 52
Trades: 0
Hmm... maybe there is something wrong with the database to understand what's happening i suggest you to always add enable mysql error show up by adding "or die(mysql_error())" to your mysql query.. so your code should be:

PHP Code:
$trafficUp       $trafficResult['in']+1;
$trafficId       $trafficResult['Id'];
mysql_query("UPDATE trafficEx SET in = '$trafficUp' WHERE id = '$trafficId'") or die(mysql_error()); 
Now it should tell you what's wrong... keep us updated!

Last edited by webmastertalker; 10-20-2010 at 05:45 AM..
webmastertalker is offline
Reply With Quote
View Public Profile
 
Old 10-20-2010, 01:16 PM Re: where is my mistake ? (mysql_query)
Skilled Talker

Posts: 52
Name: Alex
Trades: 0
are you sure there is value $trafficId in the field "id"?
elf2002 is offline
Reply With Quote
View Public Profile
 
Old 10-21-2010, 10:48 AM Re: where is my mistake ? (mysql_query)
Skilled Talker

Posts: 52
Trades: 0
Quote:
Originally Posted by elf2002 View Post
are you sure there is value $trafficId in the field "id"?
Yes maybe this is the problem this is why I said him to add the function to display errors.
webmastertalker is offline
Reply With Quote
View Public Profile
 
Old 10-21-2010, 11:02 AM Re: where is my mistake ? (mysql_query)
lynxus's Avatar
Awesomeo-Maximo

Posts: 1,618
Location: UK
Trades: 1
"in" is a reserved keyword, So if you have a column set to that, it probably wont work.

http://dev.mysql.com/doc/refman/5.1/...ved-words.html
__________________

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

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


lynxus is offline
Reply With Quote
View Public Profile Visit lynxus's homepage!
 
Old 10-22-2010, 05:32 AM Re: where is my mistake ? (mysql_query)
Junior Talker

Posts: 4
Name: Petr Rozsypal
Trades: 0
What about the lower and upper cases - do you really have ID inserted inside query or not? When using low and upper-case variables, this is a common problem.
blazinec is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to where is my mistake ? (mysql_query)
 

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