User Name

Register Members List Calendar Search FAQ Posting Guidelines
MySQL Fun!
Thread Tools
25 chars of wasted space.
Join Date: May 2004
Send a message via AIM to ast3r3x  
2004-07-20, 21:11

I'm creating my own forum board and having some problems. This was working, but I somehow broke it last night and have not a clue how. But here is the deal...

When I try to have my update function update, the topic count, or post count, or reply count or anything, I am getting the same problem as follows.

It outputs what I think should work...hell what was working.

<edit>Not sure where my pictures are, I'll mak sure they get up when I get home.</edit>



As you can see, it matches, doesn't change, and gives a warning. One how can I see this warning. Two, why isn't it working. Three why does if I manually set the topiccount to 1, puting that same command I just had, reset it to 0?

Last edited by ast3r3x : 2004-07-21 at 07:58.
Join Date: Jul 2004
2004-07-20, 23:34

I can't be totally sure about this since it's been a while since I've used SQL for anything but here goes:

I can see two possible things that might be wrong. First, your use of quotes. You wrote:
Update forums Set topiccount="topiccount+1". The "" indicate a string, but you have it set as an int. I would try removing the quotes, because I know SQL recognizes arithmetice operators. If that doesn't work then there is this:

This is from The Complete MySQL Reference by McGraw-Hill:

MySQL won't let you delete or update a table's data if you are simultaneously reading that same data with a subquery, as doing so raises the possibility that your subquery might reference rows that have already been deleted or altered. There for the table named in an outer DELETE or UPDATE DMl statement cannot appear in the FROM clause of an inner subquery.
25 chars of wasted space.
Join Date: May 2004
Send a message via AIM to ast3r3x  
2004-07-21, 17:08

I guess it was the quotes, but I could have swore I checked last night and it didn't make a difference. So maybe I just typed it wrong or something funky was going on. Thanks though, I guess I need to modify my function so I can choose to have quotes or not.

But...this means my website is functioning!
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Anybody out there familiar with MySQL commands? LoCash General Discussion 5 2004-07-06 19:52

« Previous Thread | Next Thread »

All times are GMT -5. The time now is 03:43.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2019, AppleNova