User Profile

Collapse

Profile Sidebar

Collapse
Marjeta
Marjeta
Last Activity: Sep 25 '09, 01:45 PM
Joined: Sep 22 '08
Location: Washington DC
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Thanks for the code. Though it's not what I need. Your code removes the comments completely, while I'd just like to remove the comment marks and keep the code iside comment. For example:
    Code:
    /*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */
    /*!50003 TRIGGER `t_dobj_ins`
    BEFORE INSERT ON `mytable` /* insert trigger for mytable */
    FOR EACH ROW BEGIN .../*more code*/ */
    should be:
    Code:
    CREATE DEFINER=`root`@`localhost` TRIGGER `t_dobj_ins`
    ...
    See more | Go to post

    Leave a comment:


  • I just found this in the reference manual:
    http://dev.mysql.com/doc/refman/5.0/en/comments.html

    This page explains, as you said, that it's related to the version.

    I'm still wondering how to get rid of those comments. We have no intentions of going back to 4.* or even 3.*, and the comments make the dump hard to read.
    And even if we ever want to go back, I'd prefer to get the error messages, so I could redesign...
    See more | Go to post

    Leave a comment:


  • Marjeta
    started a topic mysqldump wraps all trigger code in comments.

    mysqldump wraps all trigger code in comments.

    I was trying to compare a particular trigger on multiple servers.

    First I tried phpMyAdmin to script the trigger code, which unfortunately only worked on one server that has newer version of phpMyAdmin...

    Then I used mysqldump, which scripted trigger code on all the servers, bur with comments around all the trigger related code:

    phpMyAdmine scripted trigger code without comments. Why are those comments...
    See more | Go to post

  • Marjeta
    started a poll design question - getting info from 3 tables

    design question - getting info from 3 tables

    2
    no triggers, just select with long WHERE clause
    0%
    0
    action_history table, triggers, and simpler select
    0%
    2
    something else
    0%
    0
    I have 3 tables with 6 different date fields:
    - "problems" with creation_date
    - "funding_reques ts" with request_date and 3 different approval dates
    - "purchase_order s" with po_date

    I would like to select the list of all problem names where at least one of the 6 dates fall within a particular range.

    Should I:

    1) build a select statement, joining the three...
    See more | Go to post

  • Marjeta
    replied to extracting info from LDAP column?
    Thanks.
    That's what I ended up doing. I just don't like the idea of the same expression being calculated twice....
    See more | Go to post

    Leave a comment:


  • Marjeta
    started a topic extracting info from LDAP column?

    extracting info from LDAP column?

    I have a table with one of the columns being ldap info. Example value would be:
    ou=FOO,ou=BAR,o =XYZ,dc=WORLD

    From this I would like to extract the first string, in this case FOO.

    My last attempt was:

    [CODE=mysql]SELECT 1+instr(T.ldap, "=") as startpos,
    instr(T.ldap,", ") as endpos,
    mid(T.ldap,star tpos,endpos-startpos)
    FROM myTable...
    See more | Go to post
    Last edited by mwasif; Mar 12 '09, 07:22 PM. Reason: Added CODE tags

  • Masuring performance and finding bottlenecks in PHP code?

    Given a complex web site with a zillion of files, most of them including (or requiring) files, a ton of functions...
    ... is there a simple way to measure performance and find the slow functions (or blocks of code)?

    Obviously I can add code to call time() at the beginning and end of each function, and subtract. But considering the number of functions that would take a very long time.

    Is there something built in the...
    See more | Go to post

  • That fixed the problem!
    Actually, those two tables were garbled beyong repair, and had to be restored. But at least all the other tables now check ok.

    Thanks!!!!!!
    See more | Go to post
    Last edited by Marjeta; Jan 21 '09, 02:10 PM. Reason: updated response

    Leave a comment:


  • Incorrect key file for table error when upgrading from MySQL 4 to MySQL 5

    I have installed MySQL 5.0.67 yesterday. Previously we were using 4.0.

    On the development server, testing server, and training server this upgrade went smooth. The only thing I did there was run mysql_fix_privi lege_tables.
    But yesterday, after doing this same thing on production server, something went wrong, at least with one database.

    While I was in the office things looked fine. But this morning I noticed error...
    See more | Go to post

  • onSubmit: how to determine which fields have changed?

    I have a form with lots of questions and a submit button. The answers are captured in text fields.

    When <submit> is clicked, I want JavaScript to determine which fields have changed and submit only those.

    Is that possible?
    See more | Go to post

  • Marjeta
    started a topic bug in MySQL manual?

    bug in MySQL manual?

    Manual for version 4.1 has a chapter Editing Stored Procedures and Functions and Editing Triggers... But then, according to MySQL Development Roadmap stored procedures and triggers were introduced in 5.0.

    Does the manual have a problem, or is it just me?
    See more | Go to post

  • skipping versions when upgrading (want to upgrade 4.0.22 to 5.0)

    We plan to upgrade our MySQL to 5.0 , maybe 5.1 if it is stable enough by the time we actually do it.

    The manual says not to skip versions, but that sounds like lots of work.

    The tables we have are very simple, and with a quick glance at incompatible changes, it seems that we probably won't be affected by any of those incompatible tables. OK, timestamp fields requires dump-and-reload, but that's something we plan to...
    See more | Go to post

  • Yup, that works.

    Didn't work 2-3 hours ago - before I had my coffee. I guess lack of caffeine caused me to do some typos, such as forgetting a semicolon.

    By the way, this was me very first JavaScript. Yaaay, I can do JavaScript now!!! Need to add that to my resume :)

    Thanks for your help!!!!
    See more | Go to post

    Leave a comment:


  • Thanks for your response.

    I tried your suggestion:
    Code:
    function isBlank(elem, helperMsg) {
    	if(elem.value.trim().length == 0){
    but it doesn't change the field.

    Meanwhile I tried this one again, just for laughs:
    Code:
    function isBlank(elem, helperMsg) {
    	elem.value=trim(elem.value);
    	if(elem.value.length == 0){
    	...
    and now it suddenly works exactly as I wanted it. Maybe...
    See more | Go to post

    Leave a comment:


  • Marjeta
    started a topic trim spaces and check for empty form elements

    trim spaces and check for empty form elements

    I'm trying to very that the user actually entered something in the form, and not just spaces.

    I guess the problem is in the first line of isBlank() function. I've tried the following:
    • elem.value.trim ();
    • elem.value=elem .value.trim();
    • elem.value=trim (elem.value);
    • elem.value.repl ace(/^\s+|\s+$/g,"");
    and none works. It correctly gives me an error message if I leave the field completely blank.But if there's anything in the field,...
    See more | Go to post

  • Marjeta
    replied to how to run sql query
    Here's how I run it:
    mysql --host=<hostname> --socket=<socket> -u <user> -p<password> <databasename > < <script>

    or, an example
    mysql --host=localhost --socket=/var/lib/mysql.sock -u myuser -pmypass mydb < test.sql

    Note: there's no space between -p and the password.
    See more | Go to post

    Leave a comment:


  • ... in other words, RTFM. For some reason, when I was searching, I didn't find those pages. I must have used wrong keywords. You pointed me exactly where I needeed to go. Thanks!!!

    Foolowin a few links I found MySQL Development Roadmap and Which Version of MySQL to Install and Upgrading MySQL .
    See more | Go to post

    Leave a comment:


  • Marjeta
    replied to Executing a SQL script file from PHP
    in PHP
    I also found that:
    In order to have these functions available, you must compile PHP with support for the mysqli extension.

    And, of course, it requires MySQL version 4.1 or more. We are still on 4.0... Ugh!!!
    See more | Go to post

    Leave a comment:


  • Marjeta
    replied to Executing a SQL script file from PHP
    in PHP
    I looked into the mysqli_multi_qu ery() method, and it's a part of the mysqli class, which has its own connect. The description says it needs
    Our code uses mysql_connect() to connect to database. Unless I change everything else, can I make mysqli_multi_qu ery() work?...
    See more | Go to post
    Last edited by Marjeta; Sep 23 '08, 02:31 PM. Reason: fixed a typo

    Leave a comment:


  • Marjeta
    replied to Trigger Problem
    I'm trying to understand what you do here...

    would the first table be something like:
    1 bookA 13
    2 bookB 24
    3 bookC 2
    with first column being the primary key and thus unique?

    And then you would insert lines in second table, like:
    1 bookA
    3 bookC
    1 bookA
    2 bookB
    2 bookB
    where neither column is unique.

    And you would want this to make the...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...