We've got about 1,000 records in a table that have timestamps on them.
We've ran into a situation where we need to go back and update one field in
all of those records without altering the timestamp. since the timestamp is
automatically changed when the record is updated we are in a bind.
The
Never mind, I just figured it out:
First, I copied the whole 'hits' table to 'hits_bak', then ran this:
INSERT INTO `csrtech_dirserv`.`hits`
SELECT `SID` , 2 AS `AID` , `Phrase` , `IP` , `Link` , `Time` ,
`Amt` , `F`
FROM `csrtech_dirserv`.`hits_bak`
WHERE `SID` =5
So that coppied
We have a DB of customer comments that we want to display one at a time on
our web site. We want the web pages (wrote in php) to use a user
name/password on the DB that has SELECT ability and that's it.
What's the best way to cycle through the comments so that each page
requested gets the next
Just realized my subject wasn't correct, we don't want the next field, we
want the next row...
Thanks!
We have a DB of customer comments that we want to display one at a time on
our web site. We want the web pages (wrote in php) to use a user
name/password on the DB that has SELECT ability
You could do something like this:
$start = 0;
if (isset($_GET['start'])) {
$start = 1 * $_GET['start']; //make sure it's numerical
}
then query:
SELECT .. FROM .. ORDER BY date LIMIT $tart, 1
display the comment
$start++;
provide a link to thispage.php?start=$start
' )'??? Or do I
need to run the inner select and get the ID myself, then run the outer
select? I admit, I know just enough SQL to wipe the database and drop all
the tables ;-), so any help would be greatly apreciate.
Thanks!
/dev/null
--
MySQL General Mailing List
For list archives: http