giftweb-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Giftweb-discuss] CVS updated


From: Gregory Gee
Subject: [Giftweb-discuss] CVS updated
Date: Sun, 29 Feb 2004 22:41:07 -0500
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040113


  Well, I have merged all my code into CVS.  There are a few outstanding
issues that I need to finish merging.

- The new "image" field is not displyed.
- Update to the sql files.
- The printlist needs to be redone again.  Actually, I should have
  left it the way it was.

  There is a few schema updates that you will need to do.

ALTER TABLE items ADD COLUMN store text;
ALTER TABLE items ADD COLUMN cost text;
ALTER TABLE items ADD COLUMN grp_id smallint;
CREATE TABLE item_grp (grp_id smallint DEFAULT nextval('items_gid_seq'::text) NOT NULL, uid smallint, name text NOT NULL);
REVOKE ALL ON TABLE item_grp FROM PUBLIC;
GRANT ALL ON TABLE item_grp TO PUBLIC;
CREATE SEQUENCE items_gid_seq START 1 INCREMENT 1 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1;
REVOKE ALL ON TABLE items_gid_seq FROM PUBLIC;
GRANT ALL ON TABLE items_gid_seq TO PUBLIC;
ALTER TABLE ONLY item_grp ADD CONSTRAINT items_gid_uid_unique UNIQUE (grp_id, 
uid);
UPDATE giftweb SET schema_ver=0.3 WHERE schema_key=1;

  The next part you will have to run in a PHP script.

********************************************************************
$conn = ADONewConnection($dbtype);
$conn->PConnect($dbhost, $dbuser, $dbpass, $dbname);

$sql = "SELECT uid FROM users";
$result = $conn->Execute($sql);

for ($i=0; $i < $result->RecordCount(); $i++) {
    $uid = $result->fields["uid"];
    $sql2 = "INSERT INTO item_grp (uid, name) VALUES ('$uid', 'Gifts')";
    $result2 = $conn->Execute($sql2);

    $sql3 = "SELECT grp_id FROM item_grp WHERE uid='$uid'";
    $result3 = $conn->Execute($sql3);
    $gid = $result3->fields["grp_id"];

    $sql4 = "UPDATE items SET grp_id='$gid' WHERE uid='$uid'";
    $result4 = $conn->Execute($sql4);
    $result->MoveNext();
}
********************************************************************

  Please try it out.  Matthew has seen my changes and I haven't heard
any complaints yet.  Also check it out to see if I missed and merges.

  Any questions, please ask.

Thanks,
Greg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]