View Single Post
Old 03-31-2006, 05:43 PM   #1 (permalink)
Redline
PHP Student
 
Join Date: Oct 2004
Location: Forest Grove, OR
Posts: 151
Redline is on a distinguished road
Send a message via AIM to Redline Send a message via MSN to Redline
Setting a field equal to the row count of another table

Is there a way, in MySQL, to set a field in table "A" equal to a row count of another table where id = 'x'?

What I'm doing is building my own blog, more accurately the commenting system. I have a field in the table containing the blog information, which includes a field "num_comments". I'd like to be able to post comments without having to update both the comments table, and the blog table. I'm wondering if there is a specific function within MySQL that will allow me to do this?

While I'm here, how would I go about incrementing an int field without querying for the value first?
__________________
Current Project
Redline is offline   Reply With Quote