Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Posts posted by jazzman1

  1. I want you to do a var_dump() of the value of $user_id in this function (method). Something like:

     public function profile_view($user_id = null) {
                    // here 
                    var_dump($user_id); exit; 
                    $user = $user_id;
                    $stmt = $this->_db->prepare('SELECT memberID,username,email,profile_pic,active FROM members WHERE memberID = :user_id AND active="YES"');
                    $stmt->execute(array(':user_id'=>$user));
                    while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
                    $user_det = (object) array('username'=> $row['username'],'email'=>$row['email'],'profile_pic'=>$row['profile_pic'],'id'=> $row['memberID'],'active'=>$row['active']);
                    
                    return $user_det;
                    }
                    
                
            }
    
    // or 
    public function profile_view($user_id = null) {
    // here
    var_dump($user_id);
    
    $user = $user_id;
    // and here
    var_dump($user); exit;
    
    $stmt = $this->_db->prepare('SELECT memberID,username,email,profile_pic,active FROM members WHERE memberID = :user_id AND active="YES"');
    $stmt->execute(array(':user_id'=>$user));
    while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    $user_det = (object) array('username'=> $row['username'],'email'=>$row['email'],'profile_pic'=>$row['profile_pic'],'id'=> $row['memberID'],'active'=>$row['active']);
    
    return $user_det;
    }
    
    
    }
    

    PS: Copy / paste the exact output from what you're getting in the document / html page.

  2. Interesting. What is your real domain name xxxx.com.br or xxxx.srv.br?

    Is this your domain (webmail.telecel.srv.br)

    [jazz@centos-box ~]$ nmap --script smtp-open-relay.nse -p 25,465,587 webmail.telecel.srv.br
    
    Starting Nmap 5.51 ( http://nmap.org ) at 2014-12-22 07:38 EST
    Nmap scan report for webmail.telecel.srv.br (177.185.197.65)
    Host is up (0.20s latency).
    PORT    STATE    SERVICE
    25/tcp  filtered smtp
    465/tcp closed   smtps
    587/tcp closed   submission
    
    Nmap done: 1 IP address (1 host up) scanned in 2.36 secon
    

    if so the ports 465 and 587 are closed. You need to tell us 

  3.  

    I was unable to recreate that on my own test table.

    Hm...it's weird...works fine for me. The script returns bool(true).

     

    //EDIT::

     

     

    If i comment out commit in this code, then nothing is written in the tables.

     

    Like this?

    <?php
    
    $mysqli = new mysqli("::1", "lxc", "password", "test");
    
    if ($mysqli->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    
    //$mysqli->autocommit(FALSE);
     
    $stmt = $mysqli->prepare("INSERT INTO test.users (first_name,last_name) VALUES ('stelios','stelios2')");
    $stmt->execute();
    $stmt->close();
     
    $stmt = $mysqli->prepare("INSERT INTO test.users (first_name,last_name) VALUES ('stelios3','stelios4')");
    $stmt->execute();
    $stmt->close();
     
    //var_dump($mysqli->commit());
     
    $mysqli->close();
    
  4.  

    'm going to say 'no', only because I don't know how to get Windows XP to send the proper command via ethernet -- if there is one.

     

    How about to run a live cd on this machine with some copy of linux, then try to mount that hard drive giving us the partitioning information and the amount of available disk space being used by file systems?

  5.  

    I want to make script which will execute via crontab every Sunday at 0:01h and will stop at 23:59h

    Then you don't have to use two cron jobs. In my example below  my regular user (jazzman) sets up a command to be run by cron every Sunday (day 7) at 00:01 AM.

    1 0 * * 7 /usr/bin/php -f Start.php
    

    The cron task will be finished at Sunday 23:59. Or you want to run the script every minute?

     

    Anyways... you don't need to use cronjob here if I understand correctly your wishes. Just create your start.php file with the following data, then include it to the display php file. 

     

    start.php

    <?php
    
    // set the default timezone to use.
    date_default_timezone_set('America/Toronto');
    
    $curr_d = date("l");
    
    function displayMessage($day) {
     if($day != 'Sunday') {
       return null;
     }
     else {
       return "Today is Sunday";
       }
    }
    
    echo displayMessage($curr_d);
    
    

    display.php

    include('start.php');
    
  6. The default behaviour of the php.ini file would be easily changed using apache .htaccess hidden files somewhere on the web hosting directories. Have you checked for error messages in the apache error log file? How about to check the same form's values using a different language let's say bash or perl?  

  7. Friends, I have the following table:

    SELECT * FROM tbl1;
    
    +----+-------+-------+
    | id | col_1 | col_2 |
    +----+-------+-------+
    |  1 |     1 |  NULL |
    |  2 |     2 |     2 |
    |  3 |  NULL |     3 |
    |  4 |     4 |  NULL |
    +----+-------+-------+
    4 ROWS IN SET (0.00 sec)
    

    So, if I wanna update only the null values of col_2 with these from col_1 or vice versa I'm running the following update statement with mysql ifnull() func.

    mysql> UPDATE test.tbl1 t1 SET t1.col_2 = ifnull(t1.col_2, t1.col_1), t1.col_1= ifnull(t1.col_1, t1.col_2);
    
    Query OK, 3 ROWS affected (0.06 sec)
    ROWS matched: 4  Changed: 3  Warnings: 0
    
    

    Is there a way to use LEFT JOIN to get all null values from every columns and rows, then to update the columns in the same way? I notice that the sub-query failed for me within an update statement.

     

×
×
  • 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.