jazzman1
-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Posts posted by jazzman1
-
-
we need to see the result of show columns!
-
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?
-
Then the user_id column in your database / table is a char type instead integer. Change the type and try again.
-
i'm not getting the $_GET from an input , it's directly from url in this way :
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 ............................... }
-
it returns NULL with variable value
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().
-
Now, it should work properly.
-
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.
-
i have also done _ var_dump of $user before query
Can you show us that result?
-
Merry Christmas to you, too!
-
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'])) { }
-
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
-
i never worked with samba, and i going mad, coz this is second day for this simple task...and i cannot solve it
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?
-
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.
-
works for me. what db engine are you using?
-
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();
-
$msg = <<<EOD Example of string containing spacial (',", chars using heredoc syntax. EOD; echo $msg;
-
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.
-
'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?
-
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');
-
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?
-
Disregard that last post. I ran it few more times and the WHERE made no difference, in fact it was slower on occasions
Thanks anyway, Barry! it's not an important thing.
-
why don't you change the default date and timezone in the entire server rather in application level?
-
Are the values in col1 and col2 always the same, unless NULL, or is that just a coincidence in your sample data?
No. They are not the same only the column data type. It was just a coincidence.
-
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.
PHP PDO variable not working in query but static value works
in PHP Coding Help
Posted
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.