Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Sorry for the delay I wasn't at home. Are you absolutely sure that you have only one table called - "members" in this local db server? Can I also see your database credentials? There is nothing wrong with the structure in this screenshot.
  2. we need to see the result of show columns!
  3. Can I see the output of: SHOW FULL COLUMNS FROM members Run this statement via your mysql gui tool, phpmyadmin, mysql workbench or whatever you want. PS: Are you sure you're working on your local machine and your db server is a local one?
  4. Then the user_id column in your database / table is a char type instead integer. Change the type and try again.
  5. That doesn't really matter. The output is string(1) "5". Do you get the same output to those 2 variables: public function profile_view($user_id = null) { // here var_dump($user_id); $user = $user_id; // and here var_dump($user); exit ............................... }
  6. The above output is 5. It should be integer, but anyway Can you do a var_dump() of the GET variable? Do you have an empty space before or after 5 in the form input field? That's way I wanted to do var_dump().
  7. 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.
  8. Merry Christmas to you, too!
  9. Start from here: // html code <input id="Email" name="Email" placeholder="Your Email Address" class="form-control input-md" required="" type="text"> // php code if(isset($_POST['email'])) { }
  10. 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
  11. I am not familiar with this php class at all, but have experience with samba servers (by the way, actually this is not a samba server). Have you tried to establish a connection using smbclient from your Unix machine?
  12. In this example, the auto-commit mode is disabled, so no SQL statements are committed until you call the method commit explicitly. To be more precise, according the docs the default is for a SQL statement to be committed when it is completed, not when it is executed. That's a normal behaviour for the InnoDB engine.
  13. Hm...it's weird...works fine for me. The script returns bool(true). //EDIT:: 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();
  14. Here-doc. $msg = <<<EOD Example of string containing spacial (',", chars using heredoc syntax. EOD; echo $msg;
  15. also, you need to make sure that the default (139) port to this microsoft machine is opened to use: nmap -Pn -p 139 --open 10.1.1.10 nmap is a great tool.
  16. jazzman1

    EXT2 FS Limits

    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?
  17. 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');
  18. 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?
  19. Thanks anyway, Barry! it's not an important thing.
  20. why don't you change the default date and timezone in the entire server rather in application level?
  21. No. They are not the same only the column data type. It was just a coincidence.
  22. 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.