« first day (873 days earlier)      last day (4074 days later) » 

11:05 AM
Ahhh all out of votes!
 
@crypticツ Sorry I am new to this chat room, what are these cv-pls delv-pls etc?
 
@Ihsan = close vote please
 
ok,
 
@Ihsan = delete vote please
 
11:06 AM
thank you @crypticツ and @dragon112
 
hey
i have a problem with mysql
i want to import a database called web
im in mysql
used command
web<web;
after creatinf a database called web
the .sql file is web.xml
soory web.sql
and is present on the desktop
can you please tell me how to import the db
 
@techno Use easier ways and save yourself from work,such as phpMySql
 
im using xammp
 
I know for some/one PHP SAPIs there is a function I can call that will close the HTTP connection to the browser but the script continues running. It's since PHP 5.4 or so. But I can not find it any longer :/. Anybody has a clue?
 
/path/to/mysql -u $DBUSER -p$DBPASSWD --database=$DATABASE < $FILENAME
 
11:09 AM
@Ihsan nothing wrong with getting to know the mysql client
 
@techno ok, go to xammp menu and invoke phpmysql
 
hmm
how ?
im a newbie
:)
 
@Gordon I agree with that. But My philosophy is make the computers do work as much as they can
 
@wegus the user is root
and password is root
i have created a blank db called web
and the file name is web.sql
 
/pfad/zu/mysql -uroot -proot --database=web < web.sql
 
11:11 AM
logged in as root
im already in mysql
 
exit first
then the above
 
ok
i have changed the default directory to desktop
and the web.sql file is there
 
then you need to know the path to the mysql binary
 
@wegus the command execuated
without any errors
 
@Gordon ... and who am I to spoil all the fun!!! :D
 
11:13 AM
then mysql -uroot -proot
use web
show tables;
and anything should be there!
 
yep
@wegus thanks a lot
 
so you#re done :-)
have a look at pages like this one here: patrickpatoray.com/?Page=30
to learn about mysql and mysqldump!
 
@Gordon Interesting, I was born @ Essen
 
Essen? Yepp well i had just a huge salat :-)
 
(1968 Elisabeth Krankenhaus)
something like that (I cant remember ... why :D )
 
11:17 AM
@wegus i do have some problems with starting the mysql service
but the mysql app is running
i mean the process
the web app is correctly reading the db
when i have tried to start the service via services.msc
 
it just crashes
i had removed the service using the sc command
and reinstalled it
its says starting and goes to stopped
i used the workbench to start the service
 
Hi friends, I'm new to PHP, developing website in PHP without frameworks is good?
 
ups, well i just did once a mysql Server on a windows machine, and this one was a bought commercial licence! I do prefer LINUXes as Server machines.
 
well i had installed wamp and xamp on the same machine
but i removed it both
but the MySQL service cannot be started
any one any ideas?
 
11:20 AM
@Dhamu i'm maintaining a self made ERP for my companie here and i've buit my very own framework in the last 14 years - and yes this is much better and faster :-)
@Ishan= 1968 ? Well i had release date in 1966 ;-)
 
@techno look at the error logs of mysql on xampp control panel.
 
@Ihsan then what happened?
 
@wegus Is it safe from hacking?
 
@Dhamu Old programmers never die, they just recurse...
 
i am going to use codeigniter @wegus
 
11:22 AM
@Gordon I was premature, stayed 2 months in hospital, got out, and returned to Turkey, Mom and Dad were doctors.
 
@crypticツ no, not that one. It's more specific and does not work with all SAPIs (I think it is only for fastcgi but I'm not really sure) and it's much newer. ignore_user_abort is really and oldskool PHP function.
Okay, reading helps :) fastcgi_finish_request()
 
@dDhamu well it's local and behind a firewall and my users want to work, not to hack ;-)
i suggest to evaluate Zend
 
@Gordon Years later I visited Essen for a business trip, found out that it gets lost in the NordRhein metropolitan cluster, and you can go to Dusseldorf from Essen with a city bus ticket. It was shocking... But the coffe was perfect.
 
ok
 
11:28 AM
@Ihsan I see :)
 
i did a -1 - how does one vote for close?
 
@Ihsan Coffee is everything so everything was perfect.
 
yep coffee is essential!
 
@wegus you need more rep for that.
 
@dragon112 Words of wisdom....
 
11:30 AM
how much rep does one need @dragon ?
 
Well I am a bit nervous about this rep thing.
 
@Ihsan Why is that?
 
thank you @drageon112 then i am some miles away from that :)
 
People jumping in and out for reps. Not for helping.
 
11:32 AM
@Ihsan Hmmm I guess that hapens, but it's just a few that do that in my experience.
 
@Ihsan Thanks to SO they are not offering money for answers :)
 
well quality of answers is extremly good here !
 
I am a slow typer. I think... so when I wrote a thing I see ten others responded with correct or incorrect answers. And then there is the downvoting game ı encountered today... Anyway.
 
@Ihsan Well that people answer fast has nothing to do with the rep thing, they are just faster and usually first come first serve.
 
6
Q: Php append to file if the string is unique

user2130729Is it possible to check if the string that is being added to file is not already in the file and only then add it? Right now I am using $myFile = "myFile.txt"; $fh = fopen($myFile, 'a') or die("can't open file"); $stringData = $var . "\n"; fwrite($fh, $stringData); fclose...

Why does this question have +7?
I can't see how this is a good question, but maybe I'm being a hard-ass.
 
11:35 AM
@Bracketworks probably because when people google and find a question they upvote first read later?
 
Quality, and speed yes. I do not offend that. But there are people here for collecting reps I guess. And that is funny. @Rikesh It will be a hell...
Maybe reps is money...
 
@dragon112 Ah, the ole' "upvote first ask... questions later"
 
it's no really a question, it's an "i had no interest RTFM so please do the work for me" !
 
Well, I'm proud to say I have delivered it a single -1.
 
@wegus Yes, You see what I mean, the poor reppers answer them...
 
11:37 AM
dudes what's wrong here?
 foreach($keywords as $k){
    if(mb_strlen($k) > 23){
     $split = mb_split($k,23);
     foreach($split as $s_){
     array_push($array, trim($s_));
    }
  }else{
    array_push($array, trim($k));
  }
}
 
As well as an answer that won't blow the memory cap like the accepted one.
 
it returns me :
ERROR - 2013-03-07 11:36:20 --> Severity: Warning  --> mb_split() [<a href='function.mb-split'>function.mb-split</a>]: mbregex compile err: end pattern with unmatched parenthesis
 
@tereško Leave it to the kaplans, Yogesh and Rikesh...
 
then if i use split() it says it's deprecated lol
what's wrong rly? :P
 
when i do insert an $array= array(); before foreach it just works here!
 
@donotusetabtodigitthisnick My god what a nick... Well mb_split does not work like that look php.net/manual/en/function.mb-split.php
 
@Ihsan you're right, but problem is i do not have pattern
) just would like to truncate string
nothing more
 
@wegus What is the context ı am lost...
 
what are you intending to to @dono...
 
11:42 AM
@wegus truncate string from 0 to 23 char
if string length > 23 char
 
Can I retract a close vote?
 
with multybite support
 
why not using substr in multibyte:
 
@donotusetabtodigitthisnick How about mb_substr php.net/manual/en/function.mb-substr.php
@wegus See I am slow
 
@wegus omg sorry, not truncating, i need to add blank space each 23 chars
 
11:45 AM
@ihsn beeing the second with the correct answer is better then beeing the first with a wrong one ;-)
 
@Ihsan sorry, not truncating, need to put a blank sace each 23 chars
 
@wegus Hahahaha, live long and prosper!
@donotusetabtodigitthisnick The code you submitted tries to "trim" the slices actually!
 
@Bracketworks Nope. You alone can't close it, if it's closed, it means it is for reason (5 votes are rarely wrong).
 
@webarto Bah well.
IDGAF anymore ;)
 
@Bracketworks That's the spirrit!
 
11:49 AM
@Ihsan yep i need to split not substr
 
gotta go back to work guys! bye!
 
split into pieces
 
@donotusetabtodigitthisnick well you will convert your keywords array to keywords with spaces at each 24 th utf character is that right?
 
dudes @Ihsan @wegus which is the multybite equivalent to $split = str_split($k,23);
?
@Ihsan just i need this for multybytes $split = str_split($k,23);
;)
multybite support
 
11:52 AM
@wegus gbye
 
@Ihsan is $split = str_split($k,23); for multybite too?
str_split() already supports multybites?
 
@donotusetabtodigitthisnick At the manual look down the page, there are examples from users there for that.
@donotusetabtodigitthisnick and please find a better nick and icon. :D
 
@Ihsan but they all uses mb_split ( string $pattern , string $string [, int $limit = -1 ] )
 
@donotusetabtodigitthisnick link is php.net/manual/en/function.mb-split.php
 
i have no pattern to set :/
 
11:56 AM
Look down, there are other examples even for hiragana katagana which use tricky regexes with str_split.
 
@Ihsan my nick is unblievable :D kind of best nick on the planet sorry )
 
I see...
:D
 
You've earned the "Populist" badge for traits in php – any real world examples/best practices?
 
Actually ROTFL...
 
@Ihsan lol dude i cant find that damn of hiragana katagana
can you pls lol paste me, srly i can't find it :O
@Ihsan and i didn't talked about my avatar yet )
lovely
 
11:58 AM
@donotusetabtodigitthisnick Scroll down the page and you will see the user contributed notes there....
 
@Gordon Congrats :)
 
wtf they uses pattern dude )
 
is it possible to do relative header like this header("location: post.php"); ?
 
@donotusetabtodigitthisnick Well for the flies with a good taste, your avatar is the best...
 
@Ihsan i rly not need pattern and don't know what to write inside pattern field )
 
11:59 AM
mighty touching
 
@Rikesh thx
 
@Connor It's not supported according to the official RFC...but most browsers understand it.
 
@TillHelgeHelwig hmm ok can i ask one more question about PDO?
 
*saw
 
12:01 PM
@Gordon help pls dude ) $split = str_split($k,23); doesnt supports multybite
 
@Connor You can always ask. How else will you find out whether someone can provide an answer?
 
and mb_split() requires pattern :(
 
@donotusetabtodigitthisnick wow there is a good trick there... wait.,
 
@TillHelgeHelwig ok so basically its recommended to close PDO connections by doing something like this right? $database = '';
 
12:03 PM
@Connor Where did you find that recommendation?
 
well ive seen it many places and people on here too
 
@donotusetabtodigitthisnick $temp_s=mb_convert_encoding($yourstr,'UTF-16','UTF-8');
$temp_a=chunk_split($temp_s,46);
then convert back but ı am not so sure...
 
@Ihsan mmmmmmmmmmmmmmmmmmmmmmmmmm
UTF-16 .... UTF-8 .... mmmmmmmmmmmmm
:P
 
@TillHelgeHelwig this is on php website $dbh = null;
 
str_split() = chunk_split() ?
 
well the trick is making it utf16 which makes each character consistently two bytes
 
uhm ... but i think there is somenthing simple
and we are mistaking for sure... @Gordon
)
 
well you wanted it 23 chars per chunk
 
hehe
 
@Ihsan yep...
but don't want tricks would like somenthing regular
)
 
@Connor Well...obviously you can do that, if you think it's necessary...but PHP will close the connection on its own just fine. So unless you do loads of other stuff after your queries...I think you don't need to spend time on that. But that's just my opinion...there might be people in here with much deeper knowledge. ;)
 
lol, well string split with 46 will work
 
 Ok say i have this...

    public function __construct(){
    		$this->database = new Connection();
    		$this->database = $this->database->Connect();
    	}

    	public function current_user($username = NULL){
    		$statement = $this->database->prepare("SELECT * FROM agents WHERE username = ?");
    		if(!isset($username)){
    			$statement->bindParam(1, $_SESSION['logged_in']);
    		} else {
    			$statement->bindParam(1, $username);
    		}
    		$statement->execute();
    		$result = $statement->fetchAll(PDO::FETCH_ASSOC)[0];
 
12:07 PM
Of course it would be "legal".
 
@webarto any advice dude?
 
but you have to: mb_convert_encoding($arrayElemnts,'UTF-8,'UTF-16');
 
@TillHelgeHelwig and it would work
 
$split = str_split($k,23); to support multybite?
 
no 46
 
12:08 PM
@crypticツ $split = str_split($k,23); ) do you know how to make it support multybites chars?
lol i'm asking the world
 
@TillHelgeHelwig k ,thanks
 
@Ihsan valentino rossi 46 ?
 
Ok you want me to write the code for you, understood...
 
nono ) do what u have to do dude)
 
12:10 PM
@Connor may be use unset($this->database)? Not sure when PHP's GC is triggered
 
@Ihsan lol @crypticツ but that needs a pattern :( i do not have pattern i mean ...
 
@donotusetabtodigitthisnick split() is suppose to take a regular expression too
explode() does not
 
@message or best of both?
 
@donotusetabtodigitthisnick you should look into one of these us3.php.net/manual/en/ref.mbstring.php
 
@crypticツ and how to simply split a string every x chars having multybite support NOt having pattern? )
ok :( daaaamn
i feel a bad smell maybe my avatar !?
 
12:13 PM
@donotusetabtodigitthisnick you can use this in a loop? incrementing the start position? us3.php.net/manual/en/function.mb-strcut.php
 
BTW must he close the connection?
 
but the mb_split() would be better. Why don't you pastebin your code @donotusetabtodigitthisnick
 
thought connections close at the end of the script's execution
 
@donotusetabtodigitthisnick maybe using pattern '/{23}/'
:D
 
@donotusetabtodigitthisnick oooh are you asking for us to make a pattern??
 
12:19 PM
@Rikesh how did that one get 7 upvotes?
Voting fraud?
 
@Pekka웃 Sorry, which one ?
 
@Pekka웃 Magic.
 
@dragon112 probably.
 
@Pekka웃 No Idea. As I'm the one who has cv it.
No vote from my side
 
12:21 PM
@donotusetabtodigitthisnick here is the code for you to give a try:
foreach($keywords as $k){
	if(mb_strlen($k) > 23){
	 $k16 = mb_convert_encoding($k,'UTF-16','UTF-8');
     $split = str_split($k,46);
	 $k = ''
     foreach($split as $s_)$k += mb_convert_encoding($s,'UTF-8','UTF-16')+" ";
    }
    array_push($array, trim($k));
}
How to send code here anyway?
 
@Ihsan ctrl+k
 
@crypticツ Thanks a lot.
 
@Rikesh yeah, I wasn't insinuating you had voted for it, I just replied to you because you posted the cv-pls link
 
Voting gangs around?
:D
 
@Pekka웃 Ahh ok ...
 
12:27 PM
@Rikesh I would cv it, but ran out of votes long ago...
 
All you nice people here, have a nice day... Goodbye.
 
@Pekka웃 I'm not sure for gangs vote in this case..May be piped piper case...people see one up vote than all who visit feel that it must be a good question to +1 .. :)
 
@Ihsan Same to you!
 
12:45 PM
 
@ircmaxell Seems legit..
 
:-D
 
@ircmaxell will you be speaking at DPC?
 
yup
 
@Ocramius DPC?
 
12:54 PM
@ircmaxell nice :D I'm thinking of writing a small lib for the talk :)
 
lib?
@dragon112 Dutch PHP Conference
 
@ircmaxell WHAT! When is that? (I'm dutch)
 
@ircmaxell yeah, gonna be speaking too (damn I'm scared :D ) about proxies
 
nice!
 
12:55 PM
Why socket throw a warning when I use try catch block. It like I get two duplicates error. So I have to add @ sign - for example: if (!@socket_connect($this->socket,$host,$port)) { throw new Exception("Connection Failed " . socket_strerror(socket_last_error())) }
Or what is alternative way?
 
I'm doing a tutorial session, and a new talk about PHP internals
 
cool =)
 
@ircmaxell Oh, I might have to go there..
 
@I'll-Be-Back warnings are not exceptions. It's a implementation detail of PHP that sucks... Instead, look up error exceptions to convert one to the other
 
do you know if access to the tutorials is also granted to speakers? Or is it always a separate thing?
 
12:59 PM
Where can you buy tickets for the DPC?
 
@ircmaxell convert one to the other?
I just added @ sign and issue fixed.
 
> Calculations show a crowd of 2,500 people firing two AK-47s each would be able to stop our runaway locomotive within the space of 30 meters—in only a second and a half. Mission accomplished.
 

« first day (873 days earlier)      last day (4074 days later) »