1. Working with a screwed up database

    Date: 06/21/06 (C Sharp)    Keywords: database, sql

    Ok so now that I have my unions and memory issues resolved, now I need to fix this screwed up data that I have in my database.

    I have a badly created Document Control system that stores all the documents in the database in 2 tables: Current and Versioned (those are aliases.) Current obviously holds all the current documents and the Versioned table has all the old versions. The problem is though that not all the information corresponds with the correct records. For example, if you have 5 versions of a document, the version notes (which we use for ISO) for the most recent version (5) actually are associated with Version 4, along with the date it was submitted. Also, the original document version (1) has version notes and a submitted date with it as well, but obviously the first version can't have version notes so those are actually referring to the next version (2). If this sounds confusing its because it is. I don't know who designed this damn thing, but as a lesson let me say to NOT use Tribune's BMS content Management system for your document control because they don't do good database design and they blatantly steal their code from Wrox's "How to build an Intranet" book.

    So anyways I need to figure out how to get these records to correspond to the correct versions, so basically every record actually refers to the next record. Also it should be noted that SOME of the information does correspond, so I only need to move information from certain fields, not the entire row.


    SqlDataAdapter da = new SqlDataAdapter("SELECT d.mdItemID AS CurrentID, d.mdFileDescription AS CurrentFile, d.mdFileName as CurrentFileName, tblUser.usUserName AS Creator, " +
    "d.mdCreatedDate AS OriginalDocDate, tblMics_Docs_Versions.mvSubItemID AS OldID, " +
    "tblMics_Docs_Versions.mvFileName as OldFileName, usr2.usUserName as ModifiedBy, tblMics_Docs_Versions.mvNotes AS VersionNotes, " +
    "tblDepartment.dpNAME AS DepartmentName, tblMics_Docs_Versions.mvVersionedDate AS sort_date " +
    "FROM tblMics_Docs d INNER JOIN tblDepartment ON d.mdDepartmentID = tblDepartment.dpID " +
    "INNER JOIN tblUser On d.mdCreatedByUserID = tblUser.usUserID JOIN tblMics_Docs_Versions ON d.mdItemID = tblMics_Docs_Versions.mvItemID " +
    "INNER JOIN tblUser usr2 on tblMics_Docs_Versions.mvCheckedInByUserID = usr2.UsUserID " +
    "WHERE d.mdArchived = 0 UNION " +
    "SELECT d.mdItemID AS CurrentID, d.mdFileDescription AS CurrentFile, d.mdFileName as CurrentFileName, " +
    "tblUser.usUserName AS Creator, d.mdCreatedDate AS SubmittedDate, null, null, null, null, tblDepartment.dpNAME, getdate() as sort_date " +
    "FROM tblMics_Docs d INNER JOIN tblDepartment ON d.mdDepartmentID = tblDepartment.dpID " +
    "INNER JOIN tblUser On d.mdCreatedByUserID = tblUser.usUserID JOIN tblMics_Docs_Versions ON d.mdItemID = tblMics_Docs_Versions.mvItemID " +
    "INNER JOIN tblUser usr2 on tblMics_Docs_Versions.mvCheckedInByUserID = usr2.UsUserID WHERE d.mdArchived = 0 ORDER BY mdItemID ASC, sort_date ASC", con);

    try
    {
    da.Fill(ds);
    }

    catch (Exception j)
    {
    j.ToString();
    }

    ds.Tables[0].Columns.Add("Version");
    ds.Tables[0].Columns.Add("FileLocation");

    Int16 currID;
    int lastID = 0;
    int VerNum = 1;
    //This code below is used to add the version numbers to the documents because the CM system
    //Doesn't keep track and just uses a Count statement in its SQL code.

    foreach (DataRow dr in ds.Tables[0].Rows)
    {
    currID = System.Convert.ToInt16(dr["CurrentID"]);
    if ( currID == lastID )

    {
    dr["Version"] = VerNum;
    lastID = currID;
    }
    else
    {
    VerNum = 1;
    dr["Version"] = VerNum;
    lastID = currID;
    }
    if (dr["oldID"] == DBNull.Value )

    {
    dr["FileLocation"] = "BMS Current\\" + dr["DepartmentName"] + "\\" + dr["CurrentID"] + " Version " +
    dr["Version"] + " " + dr["CurrentFileName"];
    }
    else
    {
    dr["FileLocation"] = "BMS Archive\\" + dr["DepartmentName"] + "\\" + dr["CurrentID"] + " Version " +
    dr["Version"] + " " + dr["OldFileName"];
    }
    VerNum ++;
    }

    dg1.DataSource = ds.Tables[0];
    ds.Tables.Add("files");

    con.Close();
    //con.Dispose();
    ds.Dispose();
    da.Dispose();
    }

    I can try and post pictures of this in action if that'll help. Unfortunately my SQL skills aren't that good and I haven't had alot of experience with datasets. Thanks.

    Source: http://community.livejournal.com/csharp/66733.html

  2. specs for web server

    Date: 06/21/06 (Web Development)    Keywords: ecommerce, database, sql, web

    So need some opinions here. What would YOU recommend as spec. for a box to host a website (.Net,Windows 2k3,IIS 6) with, let's say, approx. 100,000 hits/mo., intranet, and database (SQLServer 2k5). Content is dynamic and served from the db, but no ecommerce or other db transactions?

    Source: http://community.livejournal.com/webdev/328591.html

  3. Working with a bad database

    Date: 06/22/06 (Asp Dot Net)    Keywords: database, sql

    I posted this in another group but got like no responses.

    Ok so now that I have my unions and memory issues resolved, now I need to fix this screwed up data that I have in my database.

    I have a badly created Document Control system that stores all the documents in the database in 2 tables: Current and Versioned (those are aliases.) Current obviously holds all the current documents and the Versioned table has all the old versions. The problem is though that not all the information corresponds with the correct records. For example, if you have 5 versions of a document, the version notes (which we use for ISO) for the most recent version (5) actually are associated with Version 4, along with the date it was submitted. Also, the original document version (1) has version notes and a submitted date with it as well, but obviously the first version can't have version notes so those are actually referring to the next version (2). If this sounds confusing its because it is. I don't know who designed this damn thing, but as a lesson let me say to NOT use Tribune's BMS content Management system for your document control because they don't do good database design and they blatantly steal their code from Wrox's "How to build an Intranet" book.

    So anyways I need to figure out how to get these records to correspond to the correct versions, so basically every record actually refers to the next record. Also it should be noted that SOME of the information does correspond, so I only need to move information from certain fields, not the entire row.


    SqlDataAdapter da = new SqlDataAdapter("SELECT d.mdItemID AS CurrentID, d.mdFileDescription AS CurrentFile, d.mdFileName as CurrentFileName, tblUser.usUserName AS Creator, " +
    "d.mdCreatedDate AS OriginalDocDate, tblMics_Docs_Versions.mvSubItemID AS OldID, " +
    "tblMics_Docs_Versions.mvFileName as OldFileName, usr2.usUserName as ModifiedBy, tblMics_Docs_Versions.mvNotes AS VersionNotes, " +
    "tblDepartment.dpNAME AS DepartmentName, tblMics_Docs_Versions.mvVersionedDate AS sort_date " +
    "FROM tblMics_Docs d INNER JOIN tblDepartment ON d.mdDepartmentID = tblDepartment.dpID " +
    "INNER JOIN tblUser On d.mdCreatedByUserID = tblUser.usUserID JOIN tblMics_Docs_Versions ON d.mdItemID = tblMics_Docs_Versions.mvItemID " +
    "INNER JOIN tblUser usr2 on tblMics_Docs_Versions.mvCheckedInByUserID = usr2.UsUserID " +
    "WHERE d.mdArchived = 0 UNION " +
    "SELECT d.mdItemID AS CurrentID, d.mdFileDescription AS CurrentFile, d.mdFileName as CurrentFileName, " +
    "tblUser.usUserName AS Creator, d.mdCreatedDate AS SubmittedDate, null, null, null, null, tblDepartment.dpNAME, getdate() as sort_date " +
    "FROM tblMics_Docs d INNER JOIN tblDepartment ON d.mdDepartmentID = tblDepartment.dpID " +
    "INNER JOIN tblUser On d.mdCreatedByUserID = tblUser.usUserID JOIN tblMics_Docs_Versions ON d.mdItemID = tblMics_Docs_Versions.mvItemID " +
    "INNER JOIN tblUser usr2 on tblMics_Docs_Versions.mvCheckedInByUserID = usr2.UsUserID WHERE d.mdArchived = 0 ORDER BY mdItemID ASC, sort_date ASC", con);

    try
    {
    da.Fill(ds);
    }

    catch (Exception j)
    {
    j.ToString();
    }

    ds.Tables[0].Columns.Add("Version");
    ds.Tables[0].Columns.Add("FileLocation");

    Int16 currID;
    int lastID = 0;
    int VerNum = 1;
    //This code below is used to add the version numbers to the documents because the CM system
    //Doesn't keep track and just uses a Count statement in its SQL code.

    foreach (DataRow dr in ds.Tables[0].Rows)
    {
    currID = System.Convert.ToInt16(dr["CurrentID"]);
    if ( currID == lastID )

    {
    dr["Version"] = VerNum;
    lastID = currID;
    }
    else
    {
    VerNum = 1;
    dr["Version"] = VerNum;
    lastID = currID;
    }
    if (dr["oldID"] == DBNull.Value )

    {
    dr["FileLocation"] = "BMS Current\\" + dr["DepartmentName"] + "\\" + dr["CurrentID"] + " Version " +
    dr["Version"] + " " + dr["CurrentFileName"];
    }
    else
    {
    dr["FileLocation"] = "BMS Archive\\" + dr["DepartmentName"] + "\\" + dr["CurrentID"] + " Version " +
    dr["Version"] + " " + dr["OldFileName"];
    }
    VerNum ++;
    }

    dg1.DataSource = ds.Tables[0];
    ds.Tables.Add("files");

    con.Close();
    //con.Dispose();
    ds.Dispose();
    da.Dispose();
    }

    I can try and post pictures of this in action if that'll help. Unfortunately my SQL skills aren't that good and I haven't had alot of experience with datasets. Thanks.

    RESOLVED: I gave up on trying to do this in SQL and instead implemented an array to store the inconsistent values and then put them in their correct places.

    Source: http://community.livejournal.com/aspdotnet/71275.html

  4. ASP.NET 2.0 Profiles

    Date: 06/23/06 (C Sharp)    Keywords: database, web, hosting

    I've got three questions.
    One - on user profiles.
    Two - on membership providers.
    Three - on the correctness of my general approach.

    So, here they go:

    1) I wrote the following code in Page_Load:

    string test_usr = "bush";
    string test_pwd = "george"; // that's why pentagon gets hacked
    string test_email = "bush@whitehouse.gov";

    Membership.CreateUser(test_usr, test_pwd, test_email);
    FormsAuthentication.Authenticate(test_usr, test_pwd);

    Profile["uid"] = "43"; // Error: the property cannot be set for anonimous user
    Profile["utype"] = "President";
    Response.Output.Write(Profile["uid"] + " " + Profile["utype"]);

    I pointed out an error in the comments above. I thought that once user is authenticated, it's assumed that I'm accessing him, when I use Profile. How do I do it properly? (Read a few articles, didn't find it.)

    2) A Membership Provider has the connection string, which tells authentication system where to store everything. Well, I went to that weird directory deep in VS.NET folders, and found the default provider, and edited it. Now membership works with my remote db properly. But, will it work when I move it to the website hosting? Doesn't seem to me that that file I edited will move along with the website. What do I do then?

    This is an approach question, if you have some time. :)
    3) We have a database of clients' data. This database, however, has no authentication fields, like passwords, usernames, and so on. I decided that authentication should be implemented separately, using Membership Providers. I've prepared a separate database for that purpose, edited the Provider, and tables were created perfectly. So I thought, I'm gonna use the User Profiles in order to store the client's id in the authentication database, which is the same id as the one stored in the client data db. This way I'm kind of connecting the two databases together. There are a couple of reasons I'm doing it. First - if I was to put all the data into User Profiles, without using separate database, it'd be slow and ineffective. Second - some clients are already in the database before they even registered on the website. (database is created independently of them). Therefore, if they do register, all I would need to do, is bind their authentication info to their actual data in the other database. Is this a good approach for the whole thing?

    Another long post, I know. Thanks for all the help so far!

    Source: http://community.livejournal.com/csharp/67218.html

  5. Resumes

    Date: 06/27/06 (IT Professionals)    Keywords: database

    Am I the only person remaining on this planet, who strongly believes that one's resume needs to be rock-solid down to the most minute detail? A resume is the very first impression that a prospective employer will ever have of you. And if it is filled with BASIC spelling and grammatical errors, what kind of impression does that give me, if you're going to be writing code that cannot afford to have syntax errors?

    "... to meet company standers... that do not match company standers..."

    "... analyzing systems, and administrate different database engines..."

    "Analyses, design, deployment..."

    "After creating the ERD model and thereby creating the database, and database, and ETL processes."

    These are all from one person's 4 page resume, that I was asked to interview this morning. Doesn't anyone bother to proof-read their resumes any more?!?!

    *bangs head against desk*

    Source: http://community.livejournal.com/itprofessionals/40315.html

  6. Whois data a key weapon in fraud fight, FTC says

    Date: 06/27/06 (Security)    Keywords: database, spyware

    The agency tells ICANN that the domain databases are critical to its fight against spyware and other Internet fraud.

    Source: http://news.zdnet.com/2100-1009_22-6088651.html

  7. nullable DateTimePicker

    Date: 06/28/06 (C Sharp)    Keywords: database, web

    I need to use a number of DateTimePicker controls on a Windows Forms 2.0 database-linked application that I'm putting together.

    The DateTimePicker control doesn't support null values, and despite trying to work around it for many hours and trying numerous 'solutions' found on the web, I'm still no closer to a fix than when I started.

    A null value for a date field in the database currently yields a control with todays date entered in.  Whereas it needs to be obvious in the application that no date has yet been entered.

    Also, if a record has say a birth date entered in, and then another record is switched to which has a null value for that birth date field, then the birth date field remains unchanged (making it appear that record 2 has the same birth date as record 1, even though in actuality - no birth date has yet been chosen for record 2).

    The variety of solutions on the web seem to be pretty much all pre-.Net 2.0, and don't have the desired result on .Net 2.0. 

    Can anyone help me out here?  Many thanks in advance!

    Source: http://community.livejournal.com/csharp/68011.html

  8. HELP: transferring database files into another computer

    Date: 06/28/06 (MySQL Communtiy)    Keywords: mysql, browser, database, sql

    My friends (team-members) and I are working on a Final Year Project, and we have a problem with mySQL!

    My team member has a complete database of our project, but i'd like to copy her database into my laptop and work from there too.


    I've copied the folder 'fyp' (C:\Program Files\MySQL\MySQL Server 5.0\data\fyp) into the same directory in my laptop.

    The following happened:

    1. The database 'fyp' showed in mySQL query browser.

    2. 'could not fetch columns' error appeared under this database in mySQL query browser.


    3. Under "Catalogs" in mySQL administrator, the schemata 'fyp' is there, but it doesnt show its tables when i clicked on it.


    DID I MISS OUT ANY FILES? DO I HAVE TO COPY ANY OTHER FILES OTHER THAN THE DATABASE 'FYP' FOLDER?

    Kindly advise!

    Thanks!

    With love,
    the mySQL noob. =/

    Source: http://community.livejournal.com/mysql/98792.html

  9. Dynamic Content

    Date: 06/29/06 (Web Development)    Keywords: blogging, rss, software, database, web

    I’m looking into how one would set up an RSS feed a smallish website for fun/learning. I think my preferred method is to have a function that is called when the journal is updated that generates a static RSS page, rather than have the RSS feed query the database itself.

    I like this method because an RSS feed isn’t really what I think of when I think dynamic content – it’s the same for every visitor. If you have 50-100 visitors between updates, you just saved yourself 49-99 database calls. It also feels more secure. If you’re querying a database, there is potential to fall victim to a injection attack. Well, the point where one updated the journal is still vulnerable, but that’s true in either method.

    I was looking at how some of the blogging software generates RSS, but they all query the database directly from the feed. Is there something I’m missing? Why is this method so overwhelmingly preferred?

    Source: http://community.livejournal.com/webdev/331678.html

  10. Joy.

    Date: 06/29/06 (PHP Community)    Keywords: php, programming, database

    I love how whenever I run into a problem and I post it here, it's always something that I know I should already know how to do.

    Seriously, this should be something really easy, right?

    The project that I'm working on, and really haven't had much time to deal with lately due to other stuff, is the same one that I'm always working on when I post here: A document tracking system for my mom's work.

    A whilie ago I ran into problems converting the system to an older version of PHP (it works fine now, in that regard), and now this.

    It works just fine, and does everything I want. I'm now trying to clean it up from slow and clunky code that was only used for the purpose of making sure the hard stuff worked (ironically, i had little to no problems doing the complicated logic stuff).


    So when bringing up the application, the user is given a form to fill out that essentially sends an e-mail, and has a vague e-mail feel to it anyway. The user has 10 drop-down menus for a maximum of 10 users. In the database, there is a table with all the users available. As a quick and dirty way of populating the list of names, I just wrote a small function that queries the database and plugs the names into the drop-down box. Well, right now, since there are 10 boxes, it does that 10 times. And it's SLOOOOOOW. My mom and I both knew that this wasn't how it was going to stay, it was just an easy way of testing the stuff that would.

    So, now that I'm backtracking slightly, I'm running into problems. What I want to do is pop the results of the query into an aray that mimics the structure of the table. Many rows, two columns. I set up a 2-d array, or tried to at least. The book I have isn't exactly clear on that topic, so I used what I thought I knew from regular programming languages and tried to apply that to this. Apparently it didn't work.

    I'm not sure why this doesn't work, so I'm just going to post the code used in here. Unfortunately, when I try and access the array with:

    $users = array(get_users());
    $num_of_users = count($users);
    for ($i=0; $i<$num_of_users; $i++)
    {
    echo " \n";
    }

    It doesn't do anything. So I don't really know what I'm doing wrong. I may be going about this way too hard. I wanted to just use the explode() function, but i couldn't think of how to get it to differentiate between what would go in one column versus another, and figured it would just plug it all into a 1-d array. So yeah, any help you can offer would be greatly appreciated.



    //This function pulls the users from the webusers table for use in choosing a recipient
    function get_users()
    {
    **Database Connect Information Removed**

    if (!$users_connect || !$db_select)
    {
    die("Problem connecting or selecting a database.");
    } //end if

    $query = "SELECT ename, eaddr FROM webusers ORDER BY ename";
    $result = mysql_db_query("test", $query);
    $num_of_users = mysql_num_rows($result);
    $users[$num_of_users][2] = array();
    $i = 0;
    while (list($ename, $eaddr) = mysql_fetch_row($result))
    {
    $users[$i][0] = $eaddr;
    $users[$i][1] = $ename;
    $i++;
    } //end while

    mysql_close();

    return($users);
    } //end get_users()


    Thanks so much!

    Source: http://community.livejournal.com/php/464906.html

  11. Changing test data

    Date: 06/30/06 (C Sharp)    Keywords: database

    How do you guys deal with test data that comes from a database? I've got unit tests running that check , for example that data is inserted, fetched, and updated from the database corrrectly, but obviously the data changes as it goes, which creates a lot of work (i.e., manually going in and changing all the expected values). There must be a less-retarded way to do this... any suggestions?

    Source: http://community.livejournal.com/csharp/68294.html

  12. MY SQL HELP

    Date: 07/03/06 (WebDesign)    Keywords: php, mysql, software, database, sql, security

    Ok im trying to instal XMB forum software onto a server.
    I created the database etc etc config and everything seemed to be going ok
    and then, when its finially installing I keep getting this error

    Checking PHP version.......................................................OK
    Checking Directory Structure...............................................OK
    Checking Required Files....................................................OK
    Checking Database Files....................................................OK
    Checking Database API......................................................OK
    Checking Database Connection Security......................................OK
    Checking Database Connection...............................................
    Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /homepages/11/d161790790/htdocs/Forum/install/index.php on line 997
    ERROR

    Database Connection
    XMB could not connect to the specified database. The database returned "error 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    I looked on the net and cant really make any sense of whats going on. Any ideas?
    Im 2 steps away from chucking my pc out the window.

    Source: http://community.livejournal.com/webdesign/1133538.html

  13. curdate() not workming?

    Date: 07/06/06 (MySQL Communtiy)    Keywords: mysql, database, sql

    Maybe it's the code or something else, but... should this work? I am trying to export some data from the database.

    -----------------------------------

    $now1 = curdate();
    $now2 = $now1[0];
    $future = $now2 + 2419200;

    $query = "SELECT * FROM ibf_cal_events WHERE event_unix_from BETWEEN $now2 AND $future ORDER BY event_unix_from";

    $result = mysql_query( $query );
    $start = 1;
    $end = mysql_num_rows( $result );
    $items=0;
    $title_array = array ();
    $context_array = array ();

    while( $start <= $end ) {
    $row = mysql_fetch_row( $result );
    $id = $row[0];

    -----------------------------------

    This gave me an error message:

    Fatal error: Unknown function: curdate() in /importcalevent.php on line 18

    Line 18 is $now1 = curdate();

    I tried $now1 = getdate(); and I got this error message:

    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /importcalevent.php on line 31

    Line 31 is $end = mysql_num_rows( $result );

    So I am not sure whch is correct and which is incorrect.

    I am using MySQL 4.1

    Thanks all.

    Source: http://community.livejournal.com/mysql/99541.html

  14. computer science courses question

    Date: 07/08/06 (Computer Geeks)    Keywords: programming, software, database, java

    I am currently attending uc berkeley majoring in computer science. As part of the program at Berkeley, we get a lot of choice in the upper division computer science courses we take. Two upper division cs courses get chosen from a short list of six, two more from a short list of about fifteen, and two more from a long list which consists of technical electives in various related disciplines like math, engineering, and operations research. This variety is great -- if not a little overwhelming.

    I'm just an undergraduate student with no clue of the Big Wide World around me; I want to make choices that are both practical and fun. When I graduate, I want to either work on a software team, or as a server-side internet developer. Here are some of the core courses I am thinking about taking - only there's not room in my schedule to take them. So my question is, I assume people reading this have spent some time in the Big Wide World, so, what courses would you look for in someone you were hiring into your company? (oh, and the mandatory courses I've already taken are Structure and Interpretation of computer programs, in Scheme, Data Structures, in Java, and Machine Structures, in C and Assembly.)  Let's say you were sitting across the table from me, looking at my resume. Which one(s) of these courses would most pique your interest? Assume that as a student, I'm interested in all of the courses listed below, so the advice "take what you are most interested in" unfortunately won't help me much. Thanks for any feedback!

    List of courses on my personal short list, needs to be pruned:
    User Interface Design and Development
    Software Engineering
    Foundations of Computer Graphics
    Operating Systems and System Programming
    Programming Languages and Compilers
    Introduction to Database Systems
    Introduction to Artificial Intelligence
    Introduction to Communication Networks
    Computing with Data
    Industrial Design and Human Factors
    Industrial and Commercial Data Systems
    Introduction to Design of Human Work Systems and Organizations

    Source: http://community.livejournal.com/computergeeks/946943.html

  15. Backing Up Database…

    Date: 07/09/06 (Java Web)    Keywords: database

    I am in the process of backing up my databases as part of moving them to a different server. I will not be posting any articles during this time. Any comments for the next few hours may be lost. I will let you know once everything is up and running on the new server. Lot’s of [...]

    Source: http://blog.taragana.com/index.php/archive/backing-up-database/

  16. Newbie trying to create a table

    Date: 07/10/06 (MySQL Communtiy)    Keywords: mysql, software, database, sql, web

    I'm trying to create a database to record all the ENV variables for website visits. I haven't used mysql before, though I have a good deal of experience with MS Access and DB2, so I feel confident when working with SQL.

    I created a database called sitetrack, connected to it with:
    use sitetrack;

    and tried creating a table with the following statement:
    CREATE TABLE sitetrack(
    VISIT_DATE DATETIME,
    QUERY_STRING VARCHAR,
    SERVER_ADDR VARCHAR,
    HTTP_ACCEPT_LANGUAGE VARCHAR,
    SERVER_PROTOCOL VARCHAR,
    TZ VARCHAR,
    HTTP_CONNECTION VARCHAR,
    HTTP_REFERER VARCHAR,
    REMOTE_PORT VARCHAR,
    HTTP_USER_AGENT VARCHAR,
    HTTP_ACCEPT VARCHAR,
    GATEWAY_INTERFACE VARCHAR,
    HTTP_HOST VARCHAR,
    SERVER_SOFTWARE VARCHAR,
    SERVER_ADMIN VARCHAR,
    REMOTE_ADDR VARCHAR,
    SCRIPT_NAME VARCHAR,
    SERVER_NAME VARCHAR,
    HTTP_ACCEPT_ENCODING VARCHAR,
    DOCUMENT_ROOT VARCHAR,
    REQUEST_URI VARCHAR,
    HTTP_ACCEPT_CHARSET VARCHAR,
    REQUEST_METHOD VARCHAR,
    SCRIPT_FILENAME VARCHAR,
    HTTP_KEEP_ALIVE VARCHAR,
    PATH VARCHAR,
    SERVER_PORT VARCHAR);


    When I do this I get the following error:
    ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '
    SERVER_ADDR VARCHAR,
    HTTP_ACCEPT_LANGUAGE VARCHAR,
    SERVER_PROTOCOL VARCHAR,
    TZ ' at line 3


    It looks to me that there's something wrong with the "SERVER_ADDR VARCHAR," line, but I can't see what. I don't see SERVER_ADDR listed in the reserved words on any document I've come across. Could someone offer any advice or direct me to documentation that would help me figure this out?

    Source: http://community.livejournal.com/mysql/99714.html

  17. This function could be better

    Date: 07/12/06 (PHP Community)    Keywords: php, database

    PHP -

    I've got this function. I know there's a better way to get the keys and values of arrays, but I can't think of it. Do you have any ideas?

    EDIT >>>

    Basically, the function takes two arrays in, and looks for keys in array2 (minus a frm_ prepending for form submission) that match keys in array1. I take the key from array1 and put the value of array2 in the output array.

    array2 is the $_SESSION array. array1 is an array of values from a database entry. Fields from a form are saved in the $_SESSION array so I can fill them in if there was an error on insertion.

    <<<


    function joinData($array1, $array2) {
    	$len1 = count($array1); //length of array 1 - speeds up loops
    	$len2 = count($array2); //length of array 2
    
    	$keys1 = array_keys($array1); //keys of array1
    	$vals1 = array_values($array1); //values of array 1
    
    	$keys2 = array_keys($array2); //keys of array2
    	$vals2 = array_values($array2); //values of array 2
    
    	$output = array(); //what we send out
    
    	for($i=0;$i<$len1;$i++) { //foreach element in array 1
    		for($j=0;$j<$len2;$j++) { //search each element in array 2
    			if( ($keys1[$i] == ereg_replace("frm_","",$keys2[$j])) ) { //until we find a key that matches after stripping frm_
    				$output[$keys1[$i]] = $vals2[$j]; // overwrite the value in array1; array2 takes precidence
    				break; // go to next element in array 1 - speeds up process (function is O(n log n), instead of O(n^2))
    			}
    		}
    	}
    
    	return $output; //send back the new values
    }

    Source: http://community.livejournal.com/php/469583.html

  18. Database Binary Conversion

    Date: 07/17/06 (C Sharp)    Keywords: database, web

    Hello, long time lurker, first time poster here. :)

    I'm currently working with your typical sandbox Northwind Database and C# .NET. I have set up a Datagrid class to spit out the contents of a certain table in the database (Employees). However, one of the fields in the database, "Photo", currently takes a Binary representation of an image.

    My goal is to take the binary and convert it into a relevant image for display on a website, all in a Datagrid control.

    Would anybody know of a way to go about doing this, or at least point me in the right direction?

    Thanks!

    Source: http://community.livejournal.com/csharp/70616.html

  19. Google Malware Search Engine And How It Works; Impact

    Date: 07/18/06 (Java Web)    Keywords: software, database, asp, virus, web, hosting, google

    H. D. Moore (hdm[at]metasploit.com) has devised a Ruby based search engine that finds malicious windows software (viruses, trojans etc.) using standard Google queries. The Malware search engine finds Web sites hosting malicious files after an user enters the name of a virus or Trojan horse. Currently the signature database is small but still contains dangerous viruses [...]

    Source: http://blog.taragana.com/index.php/archive/google-malware-search-engine-and-how-it-works-impact/

  20. Oracle plugs 65 security holes

    Date: 07/18/06 (Security)    Keywords: database

    July patch update includes fixes for flaws, many serious, across the company's database and business products.

    Source: http://news.zdnet.com/2100-1009_22-6095620.html

Previous page  ||  Next page


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home