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
MySql Error I Need Help ...
Old 11-07-2010, 09:20 AM MySql Error I Need Help ...
ZoC
Skilled Talker

Posts: 68
Trades: 0
Hello there, hope someone can tell me how i can fix this

Table Create:
PHP Code:
CREATE TABLE IF NOT EXISTS `trafficEx` (
  `
idint(11NOT NULL auto_increment,
  `
titlevarchar(50NOT NULL,
  `
urlvarchar(150NOT NULL,
  `
inint(11NOT NULL DEFAULT '0',
  `
outint(11NOT NULL DEFAULT '0',
  
UNIQUE KEY `id` (`id`)
AUTO_INCREMENT=
Php Code:
PHP Code:
mysql_query("update trafficEx set in=in+1 where url='$result[0]'") or die(mysql_error()); 
when i try to run this command he give me MySql error ... can someone please help me with this ... (he dont make update to in or out but if i try to make update to title works)
ZoC is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-07-2010, 09:25 AM Re: MySql Error I Need Help ...
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the error is??

what does the query look like as it is sent to the MySql server?
__________________
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 online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-07-2010, 09:32 AM Re: MySql Error I Need Help ...
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
IN is a reserved word in mysql. You'll have to refer to the table as `in` or trafficEx.in. Better yet, don't name your column in.
__________________

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

Last edited by NullPointer; 11-07-2010 at 09:33 AM..
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 11-07-2010, 10:40 AM Re: MySql Error I Need Help ...
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Try this query:

Code:
mysql_query("update trafficEx set in=in+1 where url='".$result[0]."'") or die(mysql_error());
And NP is right, don't name a column 'in', I think it's a keyword
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 11-12-2010, 02:22 PM Re: MySql Error I Need Help ...
Junior Talker

Posts: 2
Name: koula wolf
Trades: 0
Your query looks ok, if you get any error post it to see what happen.

Note: try to use other field name not 'in' because this word used by mysql.
__________________

Please login or register to view this content. Registration is FREE
koula is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MySql Error I Need Help ...
 

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