User Profile

Collapse

Profile Sidebar

Collapse
dragon52
dragon52
Last Activity: Jan 1 '17, 11:17 AM
Joined: Jun 8 '09
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • dragon52
    started a topic SELECT data from 2 databases

    SELECT data from 2 databases

    Hello,

    I hope someone can help me!

    I have 'payment' data in two databases. One db contains old/archived data. Each db contains the exact same table "PmtsTbl" but obviously the data is different.

    I want to select all payment data from both db within a date range. I have the following sql which works in "Mysql Workbench"

    Code:
    SELECT * FROM 
    (SELECT * FROM DB1.PmtsTbl
    ...
    See more | Go to post

  • Hi Luk3r,

    Thank you very much for the reply.

    As I understand it, your suggestion is not quite what I am after.

    I want to always upper the family name and never the given names.

    In the culture I am working with when names are translated to English some people put their family name first and some put their's last. I need to find a way to emphasis which is the family name.

    It can be ......
    See more | Go to post

    Leave a comment:


  • dragon52
    started a topic hover over text then display it as upper case

    hover over text then display it as upper case

    Hi,

    I have the following html and css code bits.

    Code:
    <td><span class="familyname">Johnson</span> Pat</td>
    Code:
    .familyname:hover {
        text-decoration: none;
        text-transform: uppercase;
    }
    When I hover over the family name it is changed to upper case. This much is working. Like this

    from 'Johnson Pat' to 'JOHNSON Pat'...
    See more | Go to post

  • dragon52
    started a topic Windows Live Mail

    Windows Live Mail

    Hi,

    I want to use Windows Live Mail but...

    When I tried to install 'Windows Live Mail', it tells me that I have a newer version installed already. But I can't find it. It is not on the list of programs (Start, bottom corner). I looked under 'c:/program files (x86)/Windows Live' but it is not there either.

    I am using Windows 7.

    I download and tried to install 'wlsetup-web.exe'.
    ...
    See more | Go to post

  • dragon52
    replied to XMLHttpRequest.Open not working
    Hi Dormilich,

    I have solved the problem. I have you to thank for pointing me in the right direction.

    Here are the codes, in case someone else wants to do something similar.

    javascript

    Code:
    //str_json = string in json format
    //e.g. str_json = '{"persons":[{"name":"xxx"},{"name":"yyy"}]}'
    
    var request = new XMLHttpRequest();
    ...
    See more | Go to post

    Leave a comment:


  • dragon52
    replied to XMLHttpRequest.Open not working
    I did have the <?php ?> tags but haven't shown it to you and the console.log() are in javascript.

    When I run this all I can see are the console.log() traces in js. Nothing else happens. Any other suggestions?


    HTML
    Code:
    <input type="submit" name="btnSave" value="Save" onclick="xx()" />

    javascript
    Code:
    function xx()
    ...
    See more | Go to post

    Leave a comment:


  • dragon52
    replied to XMLHttpRequest.Open not working
    Hi Dormilich,

    Can you help me further? I can't get it to work.

    I have made changes as you have suggested. It doesn't seem to be going through the php script.

    It doesn't crash, it doesn't give me an error. I can't tell what it is doing.

    The javascript part seems to be working ok because I can see the console.log() traces. If I deliberately use the wrong php file name in the .open() then it tells...
    See more | Go to post

    Leave a comment:


  • dragon52
    replied to XMLHttpRequest.Open not working
    Hi Dormilich,

    Thanks for your reply.

    I am not sure what you are telling me. What do you mean php script? The 'file_get_conte nts' bit is in php code. See below.

    From my debugging, the php can read the content of the file 'test.txt' but the javascript is not updating it. I thought that is where the problem is. The file is actually on my pc because I am using the localhost server.

    May be I need to...
    See more | Go to post
    Last edited by dragon52; Jun 19 '15, 03:34 PM. Reason: err

    Leave a comment:


  • dragon52
    started a topic XMLHttpRequest.Open not working

    XMLHttpRequest.Open not working

    Hi, I need help to understand how to send data from javascript client to php server.

    I want to save some data (a large table) from a web page to a mysql database. I thought the following js and php codes will do that. But it doesn't work so may be I don't understand the concept at all.

    The way I understand it is the javascript sends the string "555" to the file 'test.txt' on the server, and the php reads the...
    See more | Go to post

  • dragon52
    started a topic How to convert then combine field values

    How to convert then combine field values

    I have a StudentsTable which has 3 fields to describe which class a student belongs to.

    The first is session, in the db it is stored as 1 or 2.
    afternoon,morni ng (values 1, 2)

    Language, also stored as 1, 2.
    English, Chinese (values 1, 2)

    Class number which has values K1,K2,3,4,G...e tc. This list is long and changes from time to time.

    For example a student who goes to class...
    See more | Go to post

  • dragon52
    replied to $mysqli->real_escape_string() not working
    Yes, you are right.

    I didn’t realise the browser would convert chars back automatically.

    Thank you very much Luuk. Problem solved.
    See more | Go to post

    Leave a comment:


  • dragon52
    replied to $mysqli->real_escape_string() not working
    Thanks for your reply Luuk.

    This is part of the code for a registration form. I save the user info to a mysql database. I am trying to validate the user input to eliminate potential problems such as chars "/<>'"\".

    I test the code on my PC before migrating it to the server. So the code is the same in both environments.

    I look at the db records created and noticed the functions have no effect...
    See more | Go to post

    Leave a comment:


  • dragon52
    replied to $mysqli->real_escape_string() not working
    Thanks for your reply Luuk.

    I did have $okName in my program. That was a typing error in my question. Sorry.

    Any other ideas? What can be the difference between the systems on my PC and the server?
    See more | Go to post

    Leave a comment:


  • dragon52
    started a topic $mysqli->real_escape_string() not working

    $mysqli->real_escape_string() not working

    Hi there,

    Can anyone tell me why the escape_string routines work on my PC but not on the server?

    I am using object version of mysqli

    PC PHP version = 5.2.9-2
    Server PHP version = 5.3.2-1

    Code:
    if ($mysqli->set_charset("utf8")) {
    }
    
    $okName = $mysqli->real_escape_string($_POST['Name']);
    $okName = htmlspecialchars(okName);
    ...
    See more | Go to post

  • dragon52
    started a topic form validation using htmlspecialchars

    form validation using htmlspecialchars

    hi guys,

    I am writing a page to update database. I have being told to always scan every form input with functions trim(), htmlspecialchar s() and stripslashes(). I don't know how to use these functions in javascript code. I have a javascript function 'checkForm'.

    In the code below lines 11, 12, 13 don't work. Is it because eg stripslashes() is not a javascript function? What should I do to scan for corrupt input?
    ...
    See more | Go to post

  • dragon52
    started a topic tran.rollback does not work

    tran.rollback does not work

    Hi,

    Can someone check my code below? The second UPDATE fails because there is no GNameX column but the first UPDATE gets written to the db anyway. I have done a trace and it definitely executes the trans.rollback.

    Any help would be appreciated.

    Code:
                MySqlConnection conn = new MySqlConnection(DefaultSettings.ConnString);
                conn.Open();
                MySqlCommand cmd
    ...
    See more | Go to post

  • dragon52
    started a topic single transaction over multiple databases

    single transaction over multiple databases

    Hi,

    I want to transfer a user record from one database to another database. I want to do that within a single transaction to maintain data integrity, ie INSERT record to db1 and DELETE record (same data) from db2. Can someone help me with the code?

    I am using c#.

    Thanks in advance

    If I have two databases, doesn't it means I have two connections which in turn means two transactions?

    ...
    See more | Go to post

  • dragon52
    replied to how to label matching div elements
    ok, thanks very much!
    See more | Go to post

    Leave a comment:


  • dragon52
    started a topic how to label matching div elements

    how to label matching div elements

    Hi,

    How should I label matching div tags in a long piece of code? Useful when trying to find a coding error.

    I can do this

    Code:
    <div id="level1">
      <div id="level2">
      </div>
    </div>
    I don't know how to label the closing </div> tags.

    In wordpress php I do this

    Code:
    <div id="level1">
    ...
    See more | Go to post

  • dragon52
    replied to How to toggle menu in 2 languages
    Thanks for your reply dr howard.

    What you said sounds complicated, is it? I don't know much about URI and javascript. Can you elaborate or suggest an article, tutorial?
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...