« first day (757 days earlier)      last day (4205 days later) » 

12:01 AM
Coincidentally, I'm reading going over the Symfony framework right now. And not because I want to use it, but because I believe in learning from other's experience in a particular area.
 
@tereško I'll give it a look, but PHP is still new to me, and I'd like to be able to understand it atleast
 
@GeorgeSumpster When I first started, I bought the book "PHP for Absolute Beginners" by Jason Lengstorf, which helped a lot. He uses PDO all throughout that book, in which he walks you through building a blog. The system design is crumby IMO, but it gives a good feeling for the language.
2
 
12:17 AM
actually, currently i would recommend : amazon.com/Beginning-PHP-5-3-Wrox-Programmer/dp/0470413964
 
@ScottyC. I have this; amazon.com/Learning-PHP-MySQL-JavaScript-Step-By-Step/dp/… - Haven't really started reading it yet though.
 
@GeorgeSumpster then don't, it will be a horrid abomination
 
HI guys.. I have a question
 
A lot of times, those all in one books are misleading. A jack of all trades is a master of nothing.
 
12:19 AM
What if you provide an answer in comments and someone takes that crate an answer and he gets voted the right answer.. and you dont get any points for it
 
@tereško Really? I though this series of books were supposed to be really good?
 
@Dinesh Discussion for all things PHP - Don't ask whether someone is here or can help. Just tell us your problem. If anybody can and wants to help, they will. - top right corner
 
i did..
 
any book which has title containing both PHP and Mysql is bad
 
1 min ago, by Dinesh
HI guys.. I have a question
 
12:20 AM
.. this one also ads JS .. promissing to be even worse
 
@Nick.. i have a tendency to write a quetion in 2 parts.. ill take a note of it
 
@Dinesh if answer is a copy of your comment, you can flag it as pragmatism
 
Look at the mysql section. If they use mysql_connect(), you might consider getting a different book.
 
@Dinesh it someone took your comment and improved it , thus turning into a proper answer - it is legitimate
 
Has anyone here ever used design patterns like Composite, Singleton, Decorator, etc in PHP? I'm reading a book on some common ones and wondering if there are some people here I can leech off of for good information, should the concepts be a little fuzzy to me.
 
12:22 AM
@Dinesh also , if book at any point contains keyword var or global .. it is burnable
6
 
@tereško Alright, I can get that book for free on kindle, so I'll check that out
 
whatcha think now about my theme
 
@tereško That comment deserves two stars.
 
Who is this @ScottyC. and why does he trouble the chatroom with petty stars?
 
@ScottyC. i use decorator for access control .. the singleton is considered to be an antipattern and i honestly have forgot what composite pattern was ...
 
user1125394
12:24 AM
 
changed the date to match
 
@cyril the var keyword is an artifact of PHP4
 
user1125394
let's forget it
 
@LeviMorrison before I clicked on your name/saw your picture over on the right side I was like I think his picture is going to be of a cat
weird and I was right
@nick whatcha think now?
 
@LeviMorrison I'm just a guy who likes to good comments get recognized.
Gotta split for a while, guys. Might be back later.
 
12:29 AM
@ScottyC. if with composite you meant this , then yes , i use it .. but only for some domain object trees , and lately i have begun preferring an array based trees
 
have anyone one worked on hierarchical access control in MVC .. for eg. patients can see their profiles on web and the doctors can see their and all the patients profile assigned to them on web and the clinic can see doctors,patients profile.. I am not sure whether to create individual controller for clininc,doctor and patient or just one controller with different access levels..
I am sorry if this question seems vague..
 
user1125394
@Dinesh stackoverflow.com/questions/3430181/acl-implementation?lq=1 I'm using teresko's answer there with a decorator pattern around controllers
 
you could .. but actually i think best option would be placing access control on services
it seems like you would aim to restrict the available data
 
yes and also view different files for different user level.. also like doctor can do more than view profile he can also create a statistical report of all patients. and clinic can create performance statistic for all doctors etc.. which makes it more difficult in case of doin ACL approach
 
user1125394
12:37 AM
o right can wrap the datamapper with it also, didn't thought
 
I found creating multiple controller much easier but than its redundant and disrespectful to programming
:)
I have created lot of application wih different access level but never different dashboard/website for different user..
 
@benlevywebdesign link?
 
nvm lol
lol apart from taking off border-left and border-right did you change anything else lol
 
yes the date
and taking border-left and border-right off does make a difference
 
12:48 AM
@benlevywebdesign in my opinion it needs moarrrr then that...
 
@nick but doesn't it look a little better
 
user1125394
@benlevywebdesign what is the link between the port in banner and the site?
 
@benlevywebdesign it's like you changed the tires on a Pontiac Sunfire, you got new tires but its still a Sunfire ya know
 
@nick what link?
 
@benlevywebdesign huh ?
 
12:51 AM
what link
 
to your wordpress theme but you answered me
 
@cyril what link
@nick I was supposed to respond to @cyril
6 mins ago, by cyril
@benlevywebdesign what is the link between the port in banner and the site?
 
ohh k my bad
 
user1125394
@benlevywebdesign your main page
 
user1125394
 
12:57 AM
@cyril this link "New Media Design"
 
user1125394
I mean the 'link' as relation, not html link
 
ah I took that photograph
 
user1125394
a bit random
 
can you guys take a look at this one stackoverflow.com/questions/13325641/…
got me stumpped
 
yes but It is a good photo that fits in a horizontal space
 
1:10 AM
@user1804952 I don't get it... you can't iterate through a row in your database and put it into an array ?! what's your problem ?!
 
the ajax needs a file that is flat
thus the idea
what do u mean
still is what is needs
i could make it read the db
 
user1125394
Why do you generate this ajax-search.php file?
 
but then the ajax would be slowed
no
if you look the test version has the arrary in a flat file
 
user1125394
o ok you update this file from your db
 
yes
directly
on a cron job
 
user1125394
1:23 AM
would be better if the ajax-search file actually read in db no? or less performant ..
 
ya i know, but this is a simple project and a quick fix
to flat file it
just need help in making it write to a falt file
 
user1125394
to 'flatten' it use json_encode( $ids )
 
i alrdy have the code working
and outputting it perfectly
just need to write the output to a file
thats wher im stuck
the code in the qestion makes it output like that
perfect, now just need to write it to a file
 
user1125394
use a file where you have your ajax-serach.php
 
user1125394
and export a pure artists.json
 
1:27 AM
yep
 
user1125394
and ajax-serach.php will read on it
 
but how do i save it
right now its doing it on the fly
i need to save that array
 
user1125394
file_put_contents('artists.json', json_encode($artists));
 
which line for that
 
user1125394
1:35 AM
@user1804952 your $ids array, export it to a plain json file
 
@user1804952 Parse error: syntax error, unexpected T_ECHO in /home/caiapfas/public_html/thelyricsfinder.com/junk.php on line 20
 
it writing it now
but
$FileToSaveTo = fopen("test.txt", "w") or die ("Error opening file in write mode!");
fputs($FileToSaveTo, (json_encode($ids)));
fclose($FileToSaveTo) or die ("Error closing file!");
it isnt putting it in the format i need
verse
 
@nick
nevermind
 
@user1804952 file_put_contents('test.txt', json_encode($ids));
Much simpler --^
 
Fatal error: Call to a member function prepare() on a non-object in /home/caiapfas/public_html/thelyricsfinder.com/junk-STO.php on line 5
is what i get from the code posted in the question cyril
 
user1125394
1:48 AM
use this for now:
while ($row = mysql_fetch_assoc($res)) {
$ids[] = str_replace($NotAllowed, " ", $row['artist']);
}
 
user1125394
then try to learn PDO, to convert it on PDO
 
@cyril mysql_evil()? really? :P
 
kk
lol sorry still behind on learning it
 
user1125394
php.net/manual/en/pdo.construct.php (don't know much mysql myself)
 
hey
 
2:08 AM
Evening
I'm a ninja
 
if ($profup = $mysqli->prepare("UPDATE `users` LEFT JOIN `profile_dname`, `profile_email`, `profile_img`, `profile_usrname` ON users.id = profile_dname.id SET profile_dname.displayname = ?, users.displayname = ? users.id = ?")) {
    $profup->bind_param("sss", $_POST[displayname], $_POST[displayname], $arrusrselect[id]);
    $profup->execute();
    $profup->bind_result($profuparr);
    $profup->fetch();
    $profup->close();
}
 
No I'm pretty sure I'm a ninja ;)
 
would this work?
 
@Sidath define work
 
can execute as expected
 
2:11 AM
@Sidath Yes probably. Have you tried it?
 
nope. too afraid
:-O
 
p.s. mysqli makes me wanna puke. Especially the syntax of bind_param()
p.p.s. you really think you should close the connection?
 
:$
I should not?
 
@Sidath PDO instead of MySQLi, and you don't have to close it, it is automatically closed when the script finishes.
 
closing the connection after the query sounds a bit "stupid" to me. Because you will almost certainly need a db connection somewhere else in your code
Although... it looks more like you are doing a close() on the statement rather than on the connection
 
2:14 AM
@PeeHaa BTW, I didn't get it mixed up. There was a bug in the chat system :)
 
I think i'm only closing the statement
NOT the connection though
 
How can you close a statement?
 
@PeeHaa With a semicolon
 
@ShaquinTrifonoff :)
 
$stmt->close();
 
2:15 AM
@SomeKittens :P
@Sidath WHat does it do? Does it exist even?
Like what @SomeKittens said. That's how one does close a statement
doc link please
 
It doesn't appear to exist it does
 
Nice try greens... — PeeHaa 10 secs ago
@ShaquinTrifonoff what does it do?
 
@PeeHaa From the PHP manual example, /* close statement */
 
@ShaquinTrifonoff But what does it really do?
 
> Closes a prepared statement. mysqli_stmt_close() also deallocates the statement handle. If the current statement has pending or unread results, this function cancels them so that the next query can be executed.
 
@ShaquinTrifonoff I have read it twice now and I read it as "this API sucks blahblahblah this API sucks" :p
hmmmm it only clears the resource AFAICS\
 
@ShaquinTrifonoff Thanks for PDO tip
 
Wow learn something new everyday. If only I would have used MySQL :P
 
but how do you update multiple tables with prepared statements?
 
2:22 AM
@Sidath How do you update multiple tables without using prepared statements?
 
if ($profup = $mysqli->prepare("UPDATE `users` LEFT JOIN `profile_dname` ON users.id = profile_dname.id SET profile_dname.displayname = ?, users.displayname = ? users.id = ?")) {
    $profup->bind_param("sss", $_POST[displayname], $_POST[displayname], $arrusrselect[id]);
    $profup->execute();
    $profup->bind_result($profuparr);
    $profup->fetch();
    $profup->close();
}
this aint working
 
Again:
31 secs ago, by PeeHaa
@Sidath How do you update multiple tables without using prepared statements?
 
Again:
54 secs ago, by Sidath
if ($profup = $mysqli->prepare("UPDATE `users` LEFT JOIN `profile_dname` ON users.id = profile_dname.id SET profile_dname.displayname = ?, users.displayname = ? users.id = ?")) {
    $profup->bind_param("sss", $_POST[displayname], $_POST[displayname], $arrusrselect[id]);
    $profup->execute();
    $profup->bind_result($profuparr);
    $profup->fetch();
    $profup->close();
}
 
give up @PeeHaa
it's not worth your sanity
 
c'mon guys
i'm really stuck
 
2:26 AM
@tereško I might have just done do that.
 
user1125394
@tereško a DataMapper has just few methods right? wanted to make a UserDataMapper but it ends up with read (profile) create (registration+crendentials) update (profile) auth (credentials) delete (profile), and maybe 2 more, is it clean or dirty?
 
that depends on how you implement it
 
user1125394
I can try to only have 5, just need 2 reads, one for id+password and one for complete profile
 
i usually have only 3 public methods : constructor + fetch() and store() .. though names change based on moon phases
the way i write them , mapper fetched the conditions from the object
if i need to acquire data from a specific user , i would do something like :
 
user1125394
ok but you never delete :)
 
2:33 AM
oh .. yeah .. sorry
4
then again , i rarely delete data from DB to begin with
only mark it as "unavailable"
 
what about me?
 
user1125394
ok thx, I better do a AuthDataMapper for authentication process, since it's another url in the webservice anyway
 
$user = new User;
$mapper = new UserMapper( $conn );
$user->serId( 42 );
$mapper->fetch( $user );
this would retrieve data from user with ID 42
i guess , i just prefer clean APIs
 
user1125394
thx, in my case $conn is a webservice, but it's the same
 
the pattern is not tied to form of storage
 
2:37 AM
@tereško Why not a QueryObject instead?
 
user1125394
yes that's the idea
 
@KeyneON what particular problem would it solve ?
i am not attempting to abstract SQL
 
I'm reading the PoEAA, and so far, that's how I've understood the DataMapper implementation with that kind of query.
No sure yet, though.
 
if ($profup = $mysqli->prepare("UPDATE `users` LEFT JOIN `profile_dname` ON users.id = profile_dname.id SET profile_dname.displayname = ?, users.displayname = ? users.id = ?")) {
    $profup->bind_param("sss", $_POST[displayname], $_POST[displayname], $arrusrselect[id]);
    $profup->execute();
    $profup->bind_result($profuparr);
    $profup->fetch();
    $profup->close();
}
 
Kinda you have to responsabilities for the object model, the secod is to perform queries.
 
2:40 AM
can anybody tell me why this ain't working?
 
@KeyneON mapper might utilize a query builder , but only if it actually maps to SQL ... just like it would utilize PDO .. composition instead of inheritance
 
IIRC, the QueryObject doesn't depend on databases, it's an option. It could be a XML file
or a JSON...
"A Query Object is an interpreter [Gang of Four], that is, a structure of objects that can form itself into a SQL query" Can form, not necessarily.
It actually queries the domain model through the DataMapper.
 
oÕ .. oh really
that not how i would read this ... but then again , i am quite new at this oop-thing
 
lol...
 
0
Q: Mysqli mutiple table update query not working

SidathI'm trying to use a mysqli prepared statement to update multiple tables. here is the PHP if ($profup = $mysqli->prepare("UPDATE `users` LEFT JOIN `profile_dname` ON users.id = profile_dname.id SET profile_dname.displayname = ?, users.displayname = ? users.id = ?")) { $profup->bind_para...

 
2:47 AM
@tereško That's how I've understood, as I said. And you're not new to the oop-thing =P
Anyway, I need to keep reading, too early to discuss it.
 
user1125394
@KeyneON looks like activerecord with being db independant no?
 
@cyril huh?
 
user1125394
no forget, it's completely free with the query
 
the query objects are are one og the possible tools for abstraction of SQL ... they cn be used as part of data mappers , but only if those mappers are either generated or part of ORM
things like Doctrine2 would contain structures that implement query object
 
@tereško I've just opened the book again and, yeah, you seem to be right. It's a form of abstraction. In the example I was reading it's related to the Metadata Mapping
I was concerned about using domain objects to perform queries... This is new to me. Though, I've seen your answers with that kind of query for a while. Need to continue my researches... thanks for the hint.
 
@KeyneON but domain objects should NOT perform any queries to database
 
@tereško Yes, I know. Wasn't referring to this.
So far, instead of using the domain object to pass the parameters to the DataMapper, I simply pass the parameter directly to the finder as an array.
 
user image
2
 
In that case, I miss an interface for the parameters.
LOL
Got the point
That image is much better than saying "What?!!" =P
 
3:29 AM
hey
somebody know Zend Framework 2 ??
i have a problem with custom route. I need to have acces to ServiceManager from it. Actually i need to get Zend Navigation
 
1
Q: ZF2: How to get Zend\Navigation inside custom route?

Katan87I have custom router and I have to get access to Zend\Navigation inside this custom router. I was googling, asking and searching and no results :/ All I need is to find nodes with 'link' param using Zend\Navigation in my AliasSegment::match function. Here is my module.config.php: 'navigation' ...

 
@PeeHaa but he's a software engineer and a teacher
don't delete his questions
 
@Lusitanian I saw his profile... OMFG. Everybody is a teacher nowadays. Now we know what is wrong with the educational system
 
exactly
that's probably why so many crappy programmers get churned out of universities
 
yup
 
@Lusitanian If he was a teacher, you would think that he would answer more questions :D
 
and he is a published author as of age 17
@ShaquinTrifonoff heh yeah
GRAND PRIZE --- A FIRST CLASS ONE WAY TICKET TO ALBURQUERQUE
That's what I think of every time someone mentions New Mexico, donuts, sauerkraut or a 'grand prize'
 
WHAT WHY IS THAT ON SO
 
3:52 AM
beats me
 
-_-
 
BTW looks like SO wrote an entire android application for the guy
 
Yeah I saw
 
@PeeHaa Funny how the tag has got the NVidia logo :P
(Not AMD)
 
@ShaquinTrifonoff lol. :P
 
3:55 AM
@ShaquinTrifonoff Jeff Atwood is biased towards Microsoft and Nvidia!
3
 
@Lusitanian True! Windows+IIS, NVidia...
 
@Lusitanian I think he (or SO as a commercial organisation) is biased towards where the money is coming from ;)
 
Indeed :P
Heh, I am using the .NET framework for something by choice now (inb4 @DaveRandom yells at me)
 
3 messages 7 edit yay :P
@Lusitanian hehe
 
I like how these people in Chicago elected a congressman who is in a mental institution and about to go to jail because they didn't want to elect someone who's conservative.
 
3:58 AM
@Lusitanian Have you tried Windows 8 RTM?
 
@ShaquinTrifonoff I've been running on it for about a month now :P
 
@Lusitanian The RTM?
 
Yes.
Haven't I already mentioned this? :P
 
The real issue is your pattern of asking questions that are vague, off-topic, etc. Just re-read the guidelines before posting your next question :) — Lusitanian 5 secs ago
Does that come across as patronizing or rude?
Tried to avoid it because I sense defensiveness.
 
4:04 AM
@Lusitanian I sure hope so. I'm not always a bitch, but when I am I am sure people deserve it
 
It wasn't intended to come off as patronizing or rude :P
In reference to your comment -- yeah.
That would be a great slogan for a political campaign: "I'm not always a bitch, but when I am: people deserve it. @PeeHaa 2016"
 
18 mins ago, by Lusitanian
@PeeHaa but he's a software engineer and a teacher
he is a bad teacher and se
 
@NullPointer Yup.
 
@Lusitanian Will I have your vote= ±D
 
morning guys ....:)
 
4:06 AM
morning
 
@PeeHaa what's "= ±D" mean?
morning
 
@Lusitanian Approximately D? :P I don't know.
 
@Lusitanian Keyboard layout was fucked up again, but considering I am totally quadruple pinging you for every message I try to send to you I just let this one slide. I meant: ? :D
 
Oh, heh. Depends on what country you're running in :P
I can't vote in the Netherlands
 
4:09 AM
@Lusitanian Maybe that's for the better :P
 
Probably. Maybe. Dunno.
 
:D
 
#IllegalizeAllDrugsInTheNetherlandsNextElection
#AlsoMakeProstitutionIllegal
Y'know, basically destroying the tourism appeal :)
 
nooooooooooes
 
heheh
 
4:10 AM
ok ... this is it
i need have to sleep
 
sleep(28800);
 
@tereško good night .....
@Lusitanian lol
 
@tereško later
 
also .. as a parting gift - my latest pet-peeve : meta.stackoverflow.com/questions/155214/…
 
@Lusitanian I log in with the integrated fingerprint-recognition :P
 
4:12 AM
@tereško Ah, yeah; that's annoying.
 
it's a byproduct of me trolling the mvc tag
 
I'm also going to get some sleep. You all have fun. later!
 
@PeeHaa good night ....
 
4:44 AM
hi
 
@NilamDoctor hiya
 
5:10 AM
@FatimaClemeneVergabera 13 minute to join and just on chat ...
 
5:21 AM
My visitor map is working again; I just converted it to a JavaScript map :)
 
hi
do you require access to cpanel
just wanted to ask a wordpress question
to install a wordpress site
or just ftp
 
Usually you'd need access to FTP and the mysql credentials
 
5:38 AM
they say it will create the db automatically
tools>import
have an .xml file
 
you need the mysql credentials
 
5:59 AM
guys
is there a way to use the one binding parameter to update two or more fields?
 
why do you need to do that
 
' if ($name == '') {
echo "no text";
$name = *
} '
How should I go about making $name = * - That way doesn't seem to work
 
6:14 AM
you want the name be equal to asterisk?
 
Yes, for SQL
 
then just wrap it inside quotations.. to make it a string
 
Then I get: Parse error: syntax error, unexpected '}' in /home/content/78/9916378/html/getuser.php on line 6
 
you have no trailing semi-colon though
 
Ah
Thanks
 
6:18 AM
np.. its not much..
 
7:21 AM
hiya
What would be the preg match rule to include a minimum of 8 charactors only including
a to z, A to Z, - , _, `space`
 
@Sidath /^[-a-zA-Z_ ]{8,}$/
preg_match('/^[-a-zA-Z_ ]{8,}$/', $string);
 
8:10 AM
@ShaquinTrifonoff thanks
 
8:47 AM
Hey guys, I have a question about Memcached.
For example if I set my MYSQL user count into a value called "Memcached_User_Amount", what should I do in my PHP file?
echo Memcached_User_Amount?
One more thing is, should session related information should be cached?
 

« first day (757 days earlier)      last day (4205 days later) »