Jump to content

mga_ka_php

Members
  • Posts

    134
  • Joined

Posts posted by mga_ka_php

  1. i'm downloading the data from a site. by using curl

    stip the xml tags and separate the each tags with a delimiter

     

    ex. <name>my name</name><address>my address</address>.....

    then will convert that to name:my name|#|address:my address........

     

    then save that to our database.

     

    if i'm going to get that data, i will save it as an array so i could get the key and value.

     

    now as im researching the data. i found out that in the name, it has space before and after the name

    so it will be like  name: my name |#|

     

    i couldn't remove that space

  2. still didn't work. i'm getting this string from database to form like this

     

    id-name-state-city-date

     

    then use that as my url for my pages

     

    got the id, name, state, city, date from a site then save it in our database

     

    Yeah sorry I'm not sure, here's a shot in the dark...

     

    <?php
    $s = "tims  gsd       d     a	a...a      s asd f";
    $s = html_entity_decode($s);
    $s = preg_replace('/[\s|\t| ]*/' ,"" , $s);
    echo $s;
    ?>

     

     

     

  3. i'm getting information from a website using curl

     

    the data is in xml format and use preg_match to get the information like <php>content</php>, it will get content.

    and when i print it, it will display "content"

     

    but when i try to post it in the database when i check the database it, it will be posted as <php>content</php>

     

    what is the problem?

  4. is it possible that i could get and convert the content of a column.

     

    example.

    id        message

    1        have a message for you last 12993234

     

    the 12993234 is a timestamp for example.

     

    i want to have a sql statement that will get that timestamp and convert it to a date

     

    example: SELECT id, message, (statement here) AS date FROM table1

     

    id    message                                              date

    1    have a message for you last 12993234      2009-02-16

     

    12993234  --->  2009-02-16

     

    the timestamp was converted to a date format of yyyy-mm-dd

     

    is that possible? if possible how do i do that?

  5. can rsync copy only new and modified files only?

     

    i want to backup my website and copy only the updated and new files because we have an account which is almost 3GB and if i do full backup that regularly it will eat so much storage space and long load for both servers.

     

    how do i accomplish that?

     

    can you specify the parameters to be used.

     

    Thanks.

  6. thinking about this sql statement

    SELECT a.siteDomain 'Site'
    FROM sites a
    WHERE
    (
    SELECT COUNT(b.userID)
    FROM users b
    WHERE
    b.userDateRegistered between '1231513284' and '1231553482'
    )
    

     

    can i move the COUNT(b.userID) to SELECT a.siteDomain 'Site'?

  7. still doesn't work.

     

    if i remove the WHERE

     

    result would be

    Site        | New Members

    site.com  | 50

    site2.com | 10

    site3.com | 25

     

    result is good, it gets the total number of new members, all time

     

    but if i add the WHERE, it will not show all the sites, it will only show the sites with new members

     

    Site        | New Members

    site.com  | 50

    site3.com | 25

  8. How do you correct this statement

     

    SELECT a.siteID 'ID', a.siteDomain 'Site', COUNT(*) 'New Members'

    FROM sites a LEFT JOIN users b ON a.siteID=b.siteID

    WHERE

    b.userDateRegistered>='1231513284' AND

    b.userDateRegistered<='1231553482'

    GROUP BY a.siteID

     

    have 2 tables, sites and users, i want to view all the sites with how many members

     

    the problem with this code it only display the sites with >0 users

     

    i want to show even the 0 users

     

    Site        | New Members

    site.com  | 0

    site2.com | 10

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.