Forum Moderators: coopster
Something like the following:
$prev_rev = mysql_query("SELECT review FROM customers WHERE id = $id");
...
$new_review = $prev_rev['review']." ".$new_review;
$rev = mysql_query("UPDATE customers SET review = $new_review");
...
Habtom
mysql_query("UPDATE table SET field = CONCAT(field,'New Data')")
dc
mysql_query("UPDATE table SET field = CONCAT(field,'New Data')")
This way:
mysql_query("UPDATE table SET field = CONCAT('New Data',field)")
One thing I noticed though is, to leave a gap in between the old and new one. ('New Data',field) gives an output like this: New DataOld. I hope you see what I mean.
Hab
It sounds like you have something like this:
TABLE BOOKS
- bookId
- author
- price
- title
- ISBN
- reviews
What you want is
TABLE BOOK
- bookId
- authorId
- price
- title
- ISBN
TABLE AUTHORS
- author_id
- lastname
- firstname
TABLE REVIEWS
- reviewId
- bookId
- reviewText
This projects database is so small it really doesn't justify this .. I don't think.
Also, I wouldn't know how to write the queries.
That being said, I am re-starting a project that 2 coders have walked away from (the first walked away with my 50% deposit as well).
It potentially involves 'partners' and 'properties' and lots of info on each. I'll probably open a new thread just to get an idea of how many tables I will need and will also need to learn how to structure the queries.
Everyone, thanks for the help!:)
Believe me, the DB that I mentioned in the other post I made recently, started out as a text file in 1988. When that got to be a hassle, it started to run on some free dB software because, you know, it was just a personal thing and not worth putting too much effort into.
Then I wanted to have some actions programmed in, so I put it into Access where I could use some Visual Basic for Applications. That was about 1997, and I knew better by then, but, hey, it would be so much work to split the data into tables and set up relations with a couple of thousand records (which would have been split into perhaps 20,000 records if I had done it properly then). There was no real grant money to do it, and I wasn't going to do it in my free time.
Then I started sharing the data and using a desktop app wouldn't really work, so it went online, but the data just got translated.
Now there's a couple of research projects that use it and depend on it, it runs at a university supercomputing center and oh, oh, oh, I wish that at some point I had rethought the data architecture, because now I think it would probably take someone a year of full-time work to set it up right. As it is now, there are serious limitations, because essentially, the data is organized exactly how it was when this was all just one smallish ASCII text file.
Sad story and perhaps someday I will see if I can get funding to fix it up, except that doing so would be incredible drudgery.